canonical: https://jentic.com/apis/googleapis.com/workflowexecutions

# Google Workflow Executions API

The Google Workflow Executions API runs workflows defined in Google Cloud Workflows and exposes the lifecycle of each execution. Clients trigger a workflow with a JSON argument payload, observe step-by-step progress through stepEntries, cancel in-flight runs, and pull a structured execution result when complete. It also supports triggering workflows from Pub/Sub messages and exporting historical execution data for analysis. This is the runtime companion to the Workflows API, which manages workflow definitions.

## For AI agents

Trigger Cloud Workflows executions, watch step entries, cancel runs, and read final results. Runtime control plane for serverless orchestrations defined in the Workflows API.

## Scope

Does not handle workflow definition authoring, container image building, message brokering, or scheduling - use for runtime control of Cloud Workflows executions only.

## Capabilities

- Trigger a workflow execution with a JSON arguments payload
- List executions for a workflow with state filters such as ACTIVE, SUCCEEDED, or FAILED
- Cancel a running execution mid-flight
- Retrieve step entries to see the input, output, and timing of every workflow step
- Trigger workflow executions from Pub/Sub topics through the triggerPubsubExecution endpoint

## Use cases

### Event-driven serverless orchestration

Run a multi-step workflow in response to an event such as a file upload or a Pub/Sub message. The Workflow Executions API exposes triggerPubsubExecution so a workflow can be wired directly to a Pub/Sub topic without an intermediate Cloud Function. Execution state can be polled or watched through stepEntries to drive downstream UI updates.

Example prompt: POST to /v1/{+workflow}:triggerPubsubExecution with a Pub/Sub message envelope and return the resulting execution name.

### Synchronous workflow invocation from a backend

A backend service triggers a workflow with POST /v1/{+parent}/executions, polls the execution by name until state is SUCCEEDED, then reads the result field for the structured output. This pattern replaces ad-hoc step functions or hand-coded retry loops with a declarative workflow definition. The stepEntries endpoint provides observability that an opaque function call cannot.

Example prompt: Create an execution under parent projects/{project}/locations/{loc}/workflows/{workflow} with argument payload {"orderId":"abc"}, poll until state=SUCCEEDED, and return the result field.

### Operational debugging and audit

When a workflow fails, the stepEntries endpoint exposes input, output, exception, and routine name for every step, giving engineers a precise replay of execution flow. Combined with deleteExecutionHistory and exportData, teams can keep recent runs queryable while archiving older execution traces. This is essential for SRE postmortems and compliance auditing.

Example prompt: List stepEntries under a failed execution, find the step where exception is non-empty, and return its routine and exception fields.

### Agent-driven workflow control through Jentic

Operations agents can launch, monitor, and cancel Cloud Workflows runs through Jentic without engineers writing client glue. The agent searches Jentic for trigger a cloud workflow, loads the executions create operation, and executes with the JSON arguments built from a user request. State changes can be polled through the same client.

Example prompt: Through Jentic, create an execution on a named workflow with arguments derived from the user's request, then poll the execution until state is SUCCEEDED or FAILED.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/{+parent}/executions | Create a new workflow execution |
| GET | /v1/{+name} | Get execution details |
| POST | /v1/{+name}:cancel | Cancel an active execution |
| GET | /v1/{+parent}/stepEntries | List step entries for an execution |
| POST | /v1/{+workflow}:triggerPubsubExecution | Trigger an execution from a Pub/Sub message |
| POST | /v1/{+name}:exportData | Export historical execution data |

## Key resources

- **executions** — Run, list, get, and cancel workflow executions
- **stepEntries** — Per-step input, output, and timing details for an execution
- **callbacks** — Endpoints that pause workflows awaiting external callbacks

## Why Jentic

- **Setup:** Wiring the Workflow Executions API by hand means setting up OAuth 2.0 for your Google Cloud project, refreshing access tokens, and matching execution control calls against the workflowexecutions.googleapis.com host. Through Jentic you install once, import the Workflow Executions API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The Workflow Executions API puts the execution and workflow in the URL path (/v1/{name}:cancel), so a rule can pin your agent to one execution or workflow: it can create and inspect executions there and nothing else. You choose the operations it may call, so cancelling runs is not included unless you add it.
- **Credential handling:** Your Google Cloud OAuth credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. Its client secret and refresh token never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'trigger a workflow run' or 'list execution step entries', and Jentic returns the executions create or step entries operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Workflows API** — Defines and versions the workflow YAML that this API executes
- **Cloud Tasks API** — Lightweight task queue when a full multi-step workflow is overkill
- **Pub/Sub API** — Event source that triggers workflow executions through triggerPubsubExecution

## FAQ

### What authentication does the Workflow Executions API use?

It uses OAuth 2.0 (Oauth2 and Oauth2c schemes) scoped to https://www.googleapis.com/auth/cloud-platform. Through Jentic the OAuth credentials are stored encrypted and exchanged for access tokens at execution; the agent runtime never holds the refresh token.

### Where do I define the workflow itself?

Workflow definitions are managed by the separate Workflows API. Workflow Executions only handles run-time concerns: creating, listing, getting, cancelling executions and reading stepEntries. The execution endpoints reference workflows by their fully qualified name like projects/{project}/locations/{loc}/workflows/{workflow}.

### What are the rate limits for the Workflow Executions API?

Per-project quotas for execution creation and concurrent active executions are configured in the Cloud Console under APIs and Services. The published default is enough for most workloads; teams running thousands of concurrent runs request a quota increase. Step throughput within a single execution is governed separately by the Workflows runtime.

### How do I trigger a workflow execution through Jentic?

Search Jentic for trigger a cloud workflow, load the schema for POST /v1/{+parent}/executions, and execute it with the parent set to the workflow name and an argument JSON payload. Jentic returns the execution name; poll GET /v1/{+name} until state is SUCCEEDED or FAILED.

### Can I trigger workflows from Pub/Sub directly?

Yes. POST /v1/{+workflow}:triggerPubsubExecution accepts a Pub/Sub envelope and starts an execution without needing an intermediary Cloud Function. Configure your Pub/Sub subscription to push to this endpoint for fully serverless event-driven workflows.

### Can I limit what my agent is allowed to do with the Workflow Executions API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use. The Workflow Executions API puts the execution and workflow in the URL path, so a rule can pin the agent to a single workflow or execution, letting it create and inspect runs there and nothing else. You pick the operations it may call, so cancelling a run through /v1/{name}:cancel is off limits unless you explicitly grant it.
