Approvals
List pending Request Approval items and decide with @lunnoa/client.
Build a custom Approvals inbox that mirrors Approvals in Automate (/approvals). List pending items the authenticated user can decide, then approve or reject.
These examples assume an authenticated lunnoa client from the overview.
Permissions
The caller's role needs:
| Permission | Used for |
|---|---|
approvals:read | List the inbox and read approval state |
approvals:decide | Submit approve or reject (eligibility still applies) |
A 403 usually means the role lacks these permissions, or the user is not eligible for that request.
List the inbox
approvals.inbox() defaults to pending work. The default status: 'pending' also includes requests that already have some, but not enough, approvals. Pass status: 'done' for history (items you decided, or finished approvals you were eligible for).
const { items } = await lunnoa.approvals.inbox();
const history = await lunnoa.approvals.inbox({ status: 'done' });
for (const item of items) {
// item.approvalId, title, status, requiredCount, receivedApprovals,
// executionId, nodeId, workflow?, expiresAt?, canDecide,
// eligibleApprovers?, myDecision?
console.log(item.title, item.status);
}Each item includes enough context to render a review row: title, approval progress (receivedApprovals / requiredCount), the workflow name, and links via executionId / nodeId.
eligibleApprovers lists people who can still decide (workspace user id, email, and optional name). Role lists expand to current role members. The list is capped at 50 and excludes people who already decided.
for (const person of item.eligibleApprovers ?? []) {
console.log(person.email, person.name);
}Decide
Submit approve or reject by approvalId from the inbox. The execution stays paused until enough people have approved. One rejection finishes the step and resumes the run on the rejected path.
const result = await lunnoa.approvals.decide(item.approvalId, {
decision: 'approved', // or 'rejected'
comment: 'Within policy limits.',
});
// result.terminal === true when the approval step is finished
// result.canDecide reflects whether this caller can still decideWhen you already know executionId and nodeId (for example from executionPath), you can use the execution-scoped helper instead:
await lunnoa.executions.submitApproval(executionId, nodeId, {
decision: 'rejected',
comment: 'Amount exceeds limit.',
});Both paths use the same eligibility rules. Do not use executions.submitInput for Request Approval nodes; that webhook is for generic NEEDS_INPUT forms.
Approvals vs queues vs NEEDS_INPUT
| Surface | When to use |
|---|---|
Approvals (approvals.*) | Request Approval workflow nodes with eligible approvers |
Queues (queueItems.*) | Standalone work-item inboxes not tied to a single approval policy |
NEEDS_INPUT (executions.submitInput) | Generic form pauses; free-form field values, not approve/reject |
Next
- Workflows: trigger runs and render
executionPath - Queues: human-in-the-loop work items outside approvals
- Errors: handle 403 when the role or eligibility fails
- TypeScript client SDK: overview and authentication