Triggering Workflows
Create triggers that start workflows from PayMongo events or cron-based schedules, and understand trigger states.
A workflow does not run on its own. To start a workflow you create a trigger: a binding between a condition (an event name or a schedule) and a workflow ID. When the condition fires, the Workflow API creates a new instance and runs the workflow.
Trigger types
- Event-Based Triggers: fire when a named PayMongo event arrives, optionally filtered by additional conditions.
- Schedule-Based Triggers: fire on a cron schedule.
A trigger is bound to one workflow. To run multiple workflows from the same source, create multiple triggers. A workflow can have multiple triggers (for example, one schedule and one event).
Lifecycle
| State | Meaning |
|---|---|
pending | The trigger has been created but is still finishing setup (subscription confirmation or schedule registration). |
active | The trigger is fully configured and will fire when its condition is met. |
failed | The trigger could not be activated (for example, a malformed cron expression or a missing subscription). |
deleted | The trigger has been soft-deleted and will not fire. |
To inspect previous trigger fires, see Trigger Executions in the API Reference.
Updated about 5 hours ago