# Error trigger

The Error Trigger runs a workflow when another workflow ends in **failed** or **dead** state. Use it for incident routing, fallback automations, cleanup, and escalation flows.

## Add it to a workflow

1. Drop an **Error Trigger** node from the Triggers palette.
2. Optionally select a **Source workflow**. Leave it empty to listen to failures from workflows in the same workspace.
3. Choose which statuses should fire the workflow: **failed**, **dead**, or both.
4. Enable the trigger and save the workflow.

The trigger is event-driven. It does not poll and it does not expose a public URL.

## What the workflow receives

Each run receives the failing run as structured input:

```json
{
  "trigger_kind": "error_trigger",
  "event": {
    "workflow_id": "wf_123",
    "workflow_name": "Lead enrichment",
    "run_id": "run_456",
    "status": "failed",
    "error": "HTTP request failed",
    "failed_node_id": "http_1"
  },
  "input": { ... },
  "last_output": { ... },
  "_error_trigger": {
    "source_attempt": 1,
    "depth": 1
  }
}
```

Use `{event.workflow_name}`, `{event.run_id}`, `{event.error}`, or `{last_output}` in downstream nodes.

## Safety rules

- A workflow cannot trigger itself through Error Trigger.
- Error-triggered runs do not trigger other Error Trigger workflows, which prevents loops.
- Triggers only fire inside the same workspace or owner scope.
- The same source run/status/attempt is deduplicated so refreshes and retries do not create duplicate incident runs.

## Common patterns

- Notify ops when a production workflow fails.
- Create a ticket with the failing run id and error text.
- Run a cleanup workflow after a timeout moves a run to **dead**.
- Start a fallback workflow when a source integration fails.

## Example workflow

Use the workflow card below to create an Error Trigger workflow that records the failed workflow name, run id, and error message.

---

*Source: https://agentbuilder.systalink.sn/docs/trigger-error — human documentation.*
*Other language: [/docs-md/fr/trigger-error.md](/docs-md/fr/trigger-error.md).*
*Machine-readable index: [/llms.txt](/llms.txt).*
