Workflow templates
The management API provides three starting graphs. They are small enough to inspect and are intended for learning, integration scaffolding or a new definition that will be adapted before publication.
| Template | Included path | Useful for |
|---|---|---|
| Simple Comment Flow | Start, Comment, End | Checking payload rendering and the run audit trail |
| Approval Flow | Start, Human Task, approval and rejection comments, End | Building a process that pauses for an Admin decision |
| Routing And Wait Flow | Start, Set Variable, Switch, Wait, comments, End | Checking branch transitions and delayed continuation |
Retrieve them with GET /V1/workflow/templates using an integration role with workflow-management permission. The current Admin builder does not present these templates as one-click buttons.
Use a template safely
A template is a graph, not a published business process. Before saving it as a definition:
- choose the correct Magento event or API entry path;
- replace example labels, messages and payload keys;
- configure every task decision and connect each enabled decision;
- review waits, recipients, entity updates and webhook destinations;
- validate the graph and simulate each meaningful route;
- publish only after the result matches the intended Magento process.
The Approval Flow sends both Reject and Return to the same example comment. Split those paths when the business process treats them differently. The Routing And Wait Flow writes status = approved into the workflow payload; it does not change an order status.
Simple Comment Flow
This template records the current payload in the workflow audit trail and ends. It is useful for checking what an event or integration actually sends before building conditions around assumed fields.
Payloads can contain personal or commercial data. Use a controlled record and remove unnecessary fields before retaining the run as evidence.
Approval Flow
The Human Task allows Approve, Reject and Return. A live run pauses until an authorized Admin user submits one of those decisions. The run-start consumer processes the continuation after the decision is stored.
Change the task title and description so the reviewer knows what must be checked. Connect every decision that remains enabled. A closed task cannot be edited later.
Routing And Wait Flow
The example sets a payload value, routes it through a Switch and pauses the matching branch at a Wait node. Magento cron later queues the continuation, and the run-start consumer completes it.
The zero-minute example is useful for verifying queue and cron behavior. Set a real delay only after the basic continuation works and operations can monitor waiting runs.
Import versus templates
Templates come from the installed module. JSON import is for definitions transferred between environments or supplied by your own deployment process. Import may reject an existing code unless overwrite is enabled. In both cases, inspect environment-specific events, store IDs, email templates, statuses, URLs and secrets before publication.