The Approval Rule is the policy. The Approval Flow is the live case file for one Order: it records who has approved, who still must, and whether anyone has rejected. Where the previous pages designed governance, this page runs it.
How a flow begins
GET /{projectKey}/as-associate/{associateId}/in-business-unit/key=atlas-apac/approval-flows/{approvalFlowId} HTTP/1.1
{
"id": "a1b2c3d4-0000-0000-0000-000000000001",
"version": 1,
"status": "Pending",
"order": { "typeId": "order", "id": "8f2e..." },
"approvals": [],
"eligibleApprovers": [
{ "associateRole": { "typeId": "associate-role", "key": "apac-manager" } },
{ "associateRole": { "typeId": "associate-role", "key": "finance-director" } }
],
"pendingApprovers": [
{ "associateRole": { "typeId": "associate-role", "key": "apac-manager" } },
{ "associateRole": { "typeId": "associate-role", "key": "finance-director" } }
],
"currentTierPendingApprovers": [
{ "associateRole": { "typeId": "associate-role", "key": "apac-manager" } }
]
}
Who can act now: eligibility is role-based
currentTierPendingApprovers drives who should be notified now. eligibleApprovers helps gate approve and reject actions for Associates whose roles are still eligible in the hierarchy.eligibleApprovers for action eligibility. Match them against currentTierPendingApprovers to decide whether their approval is needed in the currently active tier. The broader pendingApprovers field shows roles still required across all remaining tiers.The frontend reflects these fields; the platform enforces whether the Associate can act.
Notifying approvers
currentTierPendingApprovers, but delivering the message is the integration's job. Wire it with the platform's eventing:- Create a Subscription for the Approval Flow Messages, such as
ApprovalFlowCreatedandApprovalFlowApproved, delivered to a message queue. - In the handler, read
currentTierPendingApproverson the flow, resolve the Associates who hold those roles in the Business Unit, and notify them by email or a portal alert through your own channel.
Pending status.Approving and rejecting
manage_approval_flows scope.approve action. When every role required across all tiers has approved, the platform automatically sets status to Approved.POST /{projectKey}/as-associate/{associateId}/in-business-unit/key=atlas-apac/approval-flows/{approvalFlowId} HTTP/1.1
Content-Type: application/json
{
"version": 1,
"actions": [ { "action": "approve" } ]
}
reject action, optionally giving a reason.POST /{projectKey}/as-associate/{associateId}/in-business-unit/key=atlas-apac/approval-flows/{approvalFlowId} HTTP/1.1
Content-Type: application/json
{
"version": 1,
"actions": [ { "action": "reject", "reason": "Over budget for this quarter" } ]
}
status becomes Rejected and no further approval can revive it. An Associate may also change a prior approval into a rejection while their tier is still open.Concurrency: read the version, then write
version field in each request body: you fetch the flow's current version, then submit it with your action. If another approver has acted in the meantime, your version is stale and the platform rejects the update with a 409 Concurrent modification error.Optimistic concurrency stops two approvers from acting on the same flow at the same time and corrupting its state. Always base an approval or rejection on a freshly read flow, and treat a 409 as "someone else acted, re-read and reassess." Do not retry without checking the latest state.
The flow state machine
Worked example: tracing an Atlas flow
apac-manager, tier two requires finance-director. A buyer places a qualifying AUD 60,000 order. Trace both outcomes.- Flow created. The platform creates the flow as
Pending.currentTierPendingApproverslistsapac-manager;finance-directoris inpendingApproversbut not yet current, because tier two is not open. - Tier one approves. A manager reads the flow (
version: 1) and submitsapprovewith that version. The flow advances;currentTierPendingApproversnow listsfinance-director. - Approval path. The finance director reads the now-current flow (
version: 2) and approves. All tiers are satisfied, so the platform setsstatustoApprovedand the Order proceeds. - Rejection path. If instead the finance director submits
rejectwith areason, the whole flow becomesRejectedimmediately and the Order receives the rejection, regardless of the manager's earlier approval. - Concurrency. If two managers both read
version: 1and both submitapprove, the first succeeds and bumps the version; the second receives409 Concurrent modificationand must re-read the flow before deciding whether any action is still needed.
Key takeaways
- The platform creates an Approval Flow automatically when an Order matches an active rule; it starts
Pendingand references the Order. - Eligibility is role-based: gate actions on
currentTierPendingApprovers(needed now) andeligibleApprovers(any open tier). - All tiers must approve for
Approved; a single rejection sets the whole flowRejected, and the Order receives the rejection. - Approve and reject are read-then-write: submit the current
version, and treat409 Concurrent modificationas "re-read and reassess." - The platform sends no approval notifications; subscribe to Approval Flow Messages and use
currentTierPendingApproversto notify the right approvers yourself.