A trigger is a way to fire a workflow from a payment event. The trigger is linked to a unique workflow that will be executed only if its filter condition is satisfied. If so, it will forward values from the event to the workflow in a set of configured variables corresponding to the ones expected in the workflow.Documentation Index
Fetch the complete documentation index at: https://docs.formance.com/llms.txt
Use this file to discover all available pages before exploring further.
Creating a trigger
To create a trigger, use the Create Trigger endpoint: POST{baseUrl}/api/orchestration/v2/triggers
Filter syntax
The syntax for the filter is based on the expr-lang expression language. Example filter:Testing a trigger
Before deploying a trigger to production, you can test it to verify that the filter matches correctly and that variables are extracted as expected. Use the Test Trigger endpoint: POST{baseUrl}/api/orchestration/v2/triggers/{triggerID}/test
The payload should be the payment event you want to test against:
Evaluating metadata in triggers
You can uselink() and get() functions to retrieve metadata from related accounts in your trigger variables and filters.
Accessing account metadata
To retrieve metadata from a payment’s associated account:foo metadata field from the destination account linked to the payment event.
Webhooks
You can create webhooks to get notified of Flows events, whether they succeed or fail:| Event | Description |
|---|---|
STARTED_WORKFLOW | Workflow instance has started |
SUCCEEDED_WORKFLOW | Workflow instance completed successfully |
FAILED_WORKFLOW | Workflow instance failed |
STARTED_WORKFLOW_STAGE | A workflow stage has started |
SUCCEEDED_WORKFLOW_STAGE | A workflow stage completed successfully |
FAILED_WORKFLOW_STAGE | A workflow stage failed |
SUCCEEDED_TRIGGER | Trigger fired successfully |
FAILED_TRIGGER | Trigger failed to fire |