Pattern 1: Human Approval with External System
A KYC pipeline that waits for an external AML check result:create-account step starts automatically with the AML result available via {{parent_outputs.aml-check.result}}.
Pattern 2: Multi-Stage Deployment with Manual Gates
Pattern 3: Cross-Workflow Coordination
Useevent_emit_key to chain workflows. When one workflow completes a step, it auto-resolves a trigger in another workflow:
Workflow A (data processing):
process-batch step completes, it auto-emits an event that resumes Workflow B’s wait-for-batch step.
Pattern 4: Durable Sleep
Pause a workflow for a specific duration:Pattern 5: SDK Wait for Event
Job runs can pause mid-execution and wait for an external event:Pattern 6: Batch Resolution
Resolve multiple triggers at once using prefix matching:batch-42: (e.g., batch-42:item-1, batch-42:item-2, etc.).
Monitoring Triggers
CLI
Real-Time SSE Stream
Monitor a trigger in real-time:Error Handling
Timeout Handling
When a trigger times out, the workflow follows itson_failure policy:
fail_workflow(default): The entire workflow failsskip_dependents: Downstream steps are skipped, other branches continuecontinue: The timeout is ignored, dependents proceed
Cancellation
Cancel a trigger to immediately fail the associated step:Webhook Delivery Failures
If anotify_url is configured and delivery fails:
- The delivery is persisted to the database
- Retried with exponential backoff (5s, 25s, 125s, 625s)
- After 5 failed attempts, the delivery is dead-lettered
- 4xx responses are dead-lettered immediately
Best Practices
- Use descriptive, namespaced event keys:
{type}:{entity-id}pattern prevents collisions (e.g.,kyc:user-123,deploy:release-v2.1) - Set appropriate timeouts: Use generous timeouts for human workflows (days/weeks) — the wait is free. Avoid infinite waits in production
- Handle timeout failures: Configure
on_failure: skip_dependentsorcontinuefor non-critical wait steps - Use event chaining for cross-workflow coordination:
event_emit_keyis more reliable than external HTTP calls between workflows - Monitor waiting triggers: Set up alerts for triggers approaching their timeout
- Use prefix patterns for batch operations: Design event keys with a common prefix when items are part of the same batch
Pattern 7: TypeScript SDK Client
Use the TypeScript SDK package@strait/ts for type-safe event trigger operations:
Pattern 8: Data Retention & Purge
For compliance or cost management, periodically purge old terminal triggers:EVENT_TRIGGER_RETENTION (default: 30 days). Adjust for your compliance requirements: