> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.plextera.com/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.plextera.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.plextera.com/_mcp/server.

# Workflow run completed

POST 

Delivered when a workflow run reaches `COMPLETED`.

Reference: https://docs.plextera.com/api/event-reference/workflows/workflow-run-completed

## Request

### Headers

- `X-Plextera-Delivery-Id` (string, required) — Identifier for this subscription delivery. It remains stable across retries; use `X-Plextera-Event-Id` for event deduplication.
- `X-Plextera-Event-Id` (string, required) — Stable event identifier. Identical across retry attempts for the same event. Use this to deduplicate deliveries on the receiver side.
- `X-Plextera-Event-Type` (string, required) — Event type string, e.g. `document-insights.extraction.completed`. Mirrors the `eventType` field in the body.
- `X-Plextera-Event-Occurred-At` (datetime, required) — ISO 8601 timestamp when the terminal state was reached. Mirrors the `occurredAt` field in the body.
- `X-Plextera-Api-Version` (string, required) — API version used to format this payload, e.g. `v1`. Mirrors the `apiVersion` field in the body.
- `X-Plextera-Signature` (string, required) — HMAC-SHA256 signature for verifying that the delivery originated from Plextera. Format: `t=<unix timestamp>,v1=<hex signature>`. The signed string is `<t>.<raw request body>`. See the [Event Subscriptions guide](/guides/core-guides/event-subscriptions#verifying-signatures) for full verification steps.

### Payload

- `eventId` (string, required) — Unique identifier for this event. Stable across retry attempts - use it to deduplicate deliveries on the receiver side.
- `eventType` ("workflow.run.completed", required) — String identifying the event type, e.g. `document-insights.extraction.completed`.
- `occurredAt` (datetime, required) — ISO 8601 timestamp at which the terminal state was reached.
- `apiVersion` (string, required) — API version used to format this payload.
- `data` (WorkflowRunData, required) — Event-specific payload. The shape varies by `eventType`; see the individual event schemas below.

## Types

### WorkflowRunData

Full state snapshot of the workflow run at the moment the terminal event was emitted. Includes per-step status and output for all steps in the run.

- `runId` (string, required) — Unique identifier for this workflow run.
- `workflowId` (string, required) — Identifier of the workflow that was executed.
- `status` (enum, required) — Terminal status of the run. `CLOSED` means the run was closed in Plextera Studio.
  - Allowed values: `COMPLETED`, `FAILED`, `CLOSED`
- `createdAt` (datetime, optional) — Timestamp when the run was created.
- `updatedAt` (datetime, optional) — Timestamp of the most recent status change.
- `startedAt` (datetime, optional) — Timestamp when execution began.
- `completedAt` (datetime, optional) — Timestamp when the run reached its terminal state.
- `workflow` (WorkflowSummary, optional) — Identity of the workflow that was executed.
- `progress` (WorkflowRunProgress, optional) — Step completion counters at the time the event was emitted.
- `durationMs` (long, optional) — Wall-clock elapsed time from `createdAt` to `completedAt`, in milliseconds. Omitted until the run is terminal.
- `computedDurationMs` (long, optional) — Active processing time reported by Studio, in milliseconds, excluding wait states and idle time in parallel branches. May be omitted from list summaries.
- `steps` (list of WorkflowRunStep, optional) — Per-step state and output at the time the event was emitted.
- `error` (RunError, optional) — Error detail. Present when `status` is `FAILED`; optional when `status` is `CLOSED`.

### WorkflowSummary

Brief identity information for the workflow that owns a run.

- `id` (string, optional) — Workflow identifier as configured in Plextera Studio.
- `name` (string, optional) — Human-readable workflow name.

### WorkflowRunProgress

Coarse completion counters for a workflow run. Useful for progress indicators.

- `stepsCompleted` (integer, optional) — Number of steps that have reached a terminal state (`COMPLETED`, `FAILED`, or `SKIPPED`).
- `stepsTotal` (integer, optional) — Total number of steps in the workflow definition.

### WorkflowRunStep

State and output for a single step within a workflow run.

- `id` (string, optional) — Step identifier within the workflow definition.
- `name` (string, optional) — Human-readable step name.
- `type` (string, optional) — Step type, e.g. `document_insights`, `web_function`, `data_transform`.
- `status` (enum, optional) — Current lifecycle status of this step.
  - Allowed values: `QUEUED`, `PROCESSING`, `COMPLETED`, `FAILED`, `SKIPPED`
- `message` (string, optional) — Optional status message or error description. Present when a step fails or is skipped with an explanation.
- `output` (any, optional) — Step-specific output passed through from Plextera Studio. Shape, property names, and enum casing vary by step type and may evolve with Studio; internal values such as APPLICATION\_PDF may appear here while typed public API fields use standard MIME values such as application/pdf. For document\_insights steps, extractionId is the stable correlation field; use GET /document-insights/extractions/\{extractionId} for the canonical, typed extraction response.
- `nestedRuns` (NestedWorkflowRuns, optional) — Nested workflow runs started by this step. Items may include the same full step output structure as a top-level workflow run. Use `GET /workflow-runs/{runId}` to load or refresh full nested run output by id.

### RunError

Machine-readable error detail included in `FAILED` and `REJECTED` event payloads.

- `code` (string, required) — Stable machine-readable error code. Document Insights returns `DOCUMENT_NOT_ROUTED` with `FAILED` for routing problems, `DOCUMENT_EXTRACTION_FAILED` with `FAILED` for processing or extracted-data validation problems, and `DOCUMENT_REJECTED` with `REJECTED` for document-level problems such as duplicate content or an unsupported language.
- `message` (string, required) — Human-readable explanation of the failure or rejection. Include it with the extraction ID when contacting support.

### NestedWorkflowRuns

Nested workflow runs started by this step. Items may include the same full step output structure as a top-level workflow run. Use `GET /workflow-runs/{runId}` to load or refresh full nested run output by id.

- `count` (integer, optional)
- `data` (list of WorkflowNestedRun, optional)

### WorkflowNestedRun

A sub-workflow run started by a step within the parent run. Steps within a nested run include the same per-step output structure as top-level runs. Use `GET /workflow-runs/{runId}` with the nested run's `id` to load or refresh full nested run details.

- `id` (string, optional) — Unique identifier for this nested run.
- `status` (enum, optional) — Lifecycle status of this nested run.
  - Allowed values: `PROCESSING`, `COMPLETED`, `FAILED`, `CLOSED`
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)
- `startedAt` (datetime, optional)
- `completedAt` (datetime, optional)
- `workflow` (WorkflowSummary, optional) — Identity of the nested workflow.
- `progress` (WorkflowRunProgress, optional) — Coarse completion counters for a workflow run. Useful for progress indicators.
- `durationMs` (long, optional) — Wall-clock elapsed time from `createdAt` to `completedAt`, in milliseconds. Omitted until the run is terminal.
- `computedDurationMs` (long, optional) — Active processing time reported by Studio, in milliseconds, excluding wait states and idle time in parallel branches. May be omitted from list summaries.
- `steps` (list of WorkflowRunStep, optional)
- `error` (RunError, optional) — Machine-readable error detail included in `FAILED` and `REJECTED` event payloads.