In about ten minutes, build a workflow that flags every order over £100 for review the moment it's created, and check it worked.
You'll build a workflow that watches for new orders and creates a review task for any order of £100 or more. Along the way you'll use an event trigger, a trigger filter, a Create data step and a template, then test the result and read its job.
You need a project and two entities:
| Entity | Fields |
|---|---|
orders |
customer_email (text), total (decimal), status (text) |
order_reviews |
order_id (integer), note (text) |
If you haven't created entities before, see Data modelling.
Flag large orders and select Create Workflow.The editor opens with a Start node on the canvas.
orders.total, operator gte, value 100.The filter is checked before a job is created, so orders under £100 won't start the workflow at all.
create_review and the entity to order_reviews.{
"order_id": "{{ $anythink.trigger.id }}",
"note": "Order from {{ $anythink.trigger.data.customer_email }} for £{{ $anythink.trigger.data.total }} needs review"
}
{{ $anythink.trigger.id }} is the whole value of order_id, so it's written as a number. The note mixes text and templates, so it's written as text.
Create an order that should be flagged, and one that shouldn't:
curl -X POST "https://api.my.anythink.cloud/org/$ORG_ID/entities/orders/items" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"customer_email":"sam@example.com","total":149.50,"status":"new"}'
curl -X POST "https://api.my.anythink.cloud/org/$ORG_ID/entities/orders/items" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"customer_email":"ali@example.com","total":24.00,"status":"new"}'
Then check:
Success.create_review step's data shows the review it created.order_reviews entity. There's one review: "Order from sam@example.com for £149.5 needs review".The £24 order didn't match the filter, so it left no job.
| Part | What it did |
|---|---|
| Event trigger | Started a job whenever an order was created |
| Trigger filter | Skipped orders under £100 before any job was created |
| Create data | Wrote a review, using the order's id and fields from the trigger data |
create_review to email your support inbox, or an Integration step to post to Slack. See Step types.status changed_to paid. See Triggers and scheduling.