---
title: "Workflow Run Failed"
method: POST
path: "/workflow-run-failed"
tags: ["Workflow Webhooks"]
---

# Workflow Run Failed

`POST /workflow-run-failed`

Primer notifies you with a `WORKFLOW_RUN.FAILED` webhook when a workflow run does not complete successfully.

This webhook is recommended if you use Capture or Cancel via Workflows. A workflow failure does not necessarily fail the payment or update the payment status, so this webhook is the signal you need to keep your own systems in sync when an automated capture or cancel does not succeed.

For payment workflows, the payload does not contain payment data — only the Payment ID in the `triggerEventId` field. Use the [Payments API](/api-reference/v2.4/api-reference/payments-api/get-a-payment) to retrieve the latest status and payment data for the payment linked to this ID.

Learn more about [Workflow Run failed webhooks](/workflows/monitor-workflows/workflow-run-failed-webhook) and [how Primer handles webhooks](/api-reference/get-started/configure-webhooks).

## Headers

- `X-Signature-Primary` string
- `X-Signature-Secondary` string

## Request body

- WorkflowRunFailedWebhookPayload
  - `eventType` 'WORKFLOW_RUN.FAILED', required — The type of the webhook raised. `WORKFLOW_RUN.FAILED` for failed workflow runs. Additional types may be supported in the future.
  - `version` string, required — The payload version for this `eventType`.
  - `date` string, required — The date and time when the webhook event was sent.
  - `primerAccountId` string, uuid, required — The Primer Account ID of the account that owns the failed workflow run.
  - `triggerEventId` string, nullable — An optional ID passed with the trigger to identify the origin of the event that started the workflow. For payment workflows this is the payment ID; other triggers may not set an event ID, in which case this value will be `null`.
  - `workflow` object, required — Details of the workflow that had a failed run.
    - `id` string, uuid, required — The ID of the workflow that had a failed run.
    - `name` string, required — The name of the workflow that had a failed run.
    - `version` integer, required — The version of the workflow that had a failed run.
  - `run` object, required — Details of the workflow run that failed.
    - `timestamp` string, date-time, required — The date and time when the workflow run failed.
    - `id` string, uuid, required — The ID of the workflow run that failed. Use this to locate the run in the dashboard.
    - `status` 'FAILED', required — The workflow run status. Currently always `FAILED`. In the future, additional statuses such as `COMPLETED` may be supported for Workflow Run webhooks.
    - `lastError` object, required — Details about the error that caused the workflow run to fail.
      - `applicationId` string, nullable — The application used for the block that led to the workflow run failure. Values depend on the applications used within workflows, e.g. `SLACK`, `ONFIDO`, `PRIMER_PAYMENTS`.
      - `actionId` string, nullable — The ID of the action used for the block that led to the workflow run failure. Values depend on the actions used within workflows, e.g. `send_message`, `capture_payment`, `create_ticket`.
      - `diagnosticsId` string, nullable — A diagnostics ID to help Primer debug traces when needed.
      - `message` string, nullable — The error message as also displayed in the Workflow Run Timeline.

## Response `200`

Return a 200 status to indicate that the data was received successfully

---

[API](https://skmtc.dev/primer/apis/primer-webhooks.md) · [All operations](https://skmtc.dev/primer/apis/primer-webhooks/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primer/primer-webhooks/revisions/f4be9122322f/schema)
