Resume an approved SDK action
Continue the original saved action after an authorized human approves it.
5 min readBefore you begin
- A registered agent, approved tool connection, published policy, workload credentials and supported Node.js version.
Persist pending context
Save the original action, intent ID, decision ID and expiry in your job store when approval is required.
Wait for human review
Keep the job pending. Do not execute merely because a decision exists or an approval notification arrives.

Resume the exact action
After authorized approval, call execute with the saved decision ID and unchanged action. The approval is single-use and expires.
Reconcile failures
Read the execution outcome. Unknown means the remote business result needs reconciliation; creating a new intent or blindly retrying can duplicate an effect.
Code example
After human approval, resume the saved decision with its original action. A new intent is not a retry of the paused operation.
import { AgentGuardError } from '@oxigen/agentguard-sdk';
export async function resumeApprovedAction(guard, savedJob) {
// savedJob contains the original action and its original decision ID.
try {
return await guard.execute(savedJob.decisionId, savedJob.action);
} catch (error) {
if (error instanceof AgentGuardError &&
error.execution?.executionState === 'unknown') {
return { state: 'reconciliation_required',
decisionId: savedJob.decisionId };
}
throw error;
}
}Expected result
{"decisionId":"example-decision","executionState":"succeeded","targetStatus":200}Check your setup
- The original action and decision ID were saved before the request paused.
- The saved decision is approved and unexpired; execution resumes once.
