On this page
Put the decision payload in your database before calling a workflow’s resume endpoint. Give each approval a stable request ID, bind it to the authenticated approver and pending continuation, and keep the resume reference in a server-only record. The browser should submit a decision to your application API; that API records the answer and then contacts the waiting workflow.
A recent n8n Cloud report describes a browser sending PUT to a Wait node’s resume URL and failing at the CORS preflight because the response did not allow PUT. The report’s reproducer uses a temporary resume URL and a JSON body. The issue describes that reproducer. A browser preflight asks whether the requested method and headers are allowed; the server’s Access-Control-Allow-Methods response controls whether the browser proceeds. MDN’s header reference
Two related requests show why the saved answer matters: an Activepieces feature request proposes resuming a waitpoint with the full payload, and a Dify source-level report describes a visible question whose continuation snapshot or correlation was not saved. Activepieces request Dify report This design applies that ordering in an app you control.
A small server-side proxy changes the request path: the browser calls your own authenticated decision endpoint, and the backend calls the workflow resume URL. The backend-to-workflow call is a server request, so the browser’s CORS enforcement does not govern that hop. Your API still needs its own authentication, authorization, input validation, and network error handling. This pattern keeps the secret resume reference out of page code and gives the application a durable record of what the person approved.
Download the sample CSV · Download the form field specification
Model the approval and continuation separately
Use four tables or equivalent backend records:
approval_requests:id,owner_user_id,approver_user_id,status,version,created_at,expires_at.approval_payloads:approval_request_id,payload_json,schema_version,saved_at.resume_refs:approval_request_id,provider,resume_url_encrypted,created_at. Restrict this record to server-side code.decision_receipts:approval_request_id,decision_id,actor_user_id,decision,answer_payload_json,request_version,created_at,resume_status,provider_response_code.
Treat payload_json as the complete object required by the next workflow step. For an approval of an invoice change, that might include the proposed amount, currency, invoice ID, reason, selected option, and any form answers. Do not replace it with only {approved: true} if downstream work needs the submitted fields. Keep the original request payload and the later decision payload distinct so an auditor can tell what was asked and what the approver supplied.
Set access by role. The request owner can read the request they created. The assigned approver can read the request and submit one decision while it is pending. Other signed-in users receive no record or a not-found response. The browser can read safe display fields, such as request title and expiry; it never receives the resume URL or a provider credential. If you connect Supabase, Atoms documents that connecting a project does not build the data feature for you: implement the save/readback flow and check a harmless record after refresh. Supabase and Atoms Cloud are alternative backends for one Atoms project. Atoms’ Supabase guide
Save first, then resume

AI-generated editorial concept; not a screenshot of a deployed app.
When the approver submits, the API authenticates the session and checks that the user is the assigned approver, the request is still pending, the version matches, and the expiry has not passed. Validate the full answer against the form schema. In one database transaction, insert the complete answer payload and a decision receipt, then change the request to decision_saved with a unique decision_id. A unique constraint on approval_request_id for an active decision prevents two simultaneous clicks from saving competing answers.
After the transaction commits, a server worker reads the matching private resume_refs row and sends the complete decision to the provider’s resume endpoint. Record the attempt and response on the receipt. Mark the request resumed only after the provider confirms that it accepted the continuation; this does not mean downstream work has finished. If the call fails, leave it in resume_pending with the decision preserved so an operator can inspect or retry under a defined policy. A timeout can leave the provider outcome unknown. Before retrying such a call, check whether that provider supports an idempotency key or a way to read the execution state; do not assume a second resume is harmless.
Use a conditional state update such as UPDATE ... WHERE status = 'pending' AND version = :expected_version so a stale page cannot overwrite a newer decision. The server, not the browser, chooses the resume reference from the request ID after the ownership check. Reject caller-supplied callback URLs. Allow only configured HTTPS provider destinations, validate the stored URL before each attempt, and reject redirects to unapproved hosts.
Example decision endpoint and payload
Use POST /api/approval-requests/APR-7001/decision as your application endpoint. The authenticated session supplies the actor; the request body contains a stable decision ID, the expected request version, and the full form answer. This synthetic payload contains no provider URL or credential:
The endpoint validates the session, assignee, schema, version and expiry. It locks the pending request, saves the answer and receipt, and commits. A worker then claims that saved decision and calls the configured provider. A replay of the same decision ID returns the saved receipt; a different decision for the same already-decided request returns a conflict. Keep the external network call outside the database transaction so a provider timeout cannot roll back the human answer.
Walk through a synthetic request
The accompanying sample.csv contains fictional records. For APR-7001, an employee asks whether to approve a $240 expense adjustment and the assigned reviewer selects “approve,” adds “receipt checked,” and submits. The app stores the full answer, actor, version, and timestamp in decision_receipts; only then does the worker call the private resume endpoint. The amount and note remain attached to this one approval rather than being reconstructed from a button click.
Use explicit states: pending → decision_saved → resume_pending → resumed. A reviewer can instead submit rejected, which follows the same save-before-resume sequence and sends the rejection plus its reason. Expired, cancelled, or already decided requests cannot accept a new payload. The form can show a saved confirmation as soon as the decision transaction commits, while a separate status indicates whether the downstream workflow has resumed.
Check the edges before using real requests
Use synthetic data and verify the application and provider separately:
- Submit an approval, refresh the page, and confirm the full decision payload and receipt still appear in the backend.
- Open the request as a different account. That user must not see the form, decision, or resume reference.
- Submit an old form version after the request changes. The server should reject it as stale and preserve the newer state.
- Double-click submit or replay the same
decision_id. One decision should be stored; the second request should return the existing receipt or a conflict without creating another resume action. - Reject an approval with a reason and confirm that the saved payload remains available to the authorized owner and that the workflow receives the rejection state.
- Simulate a resume timeout after the database commit. Confirm that the decision remains saved and that retry behavior follows the provider’s verified idempotency or status-read capability.
Atoms’ connector guide says available actions and permissions vary by connector and account, so inspect the current catalog before relying on a provider write. Atoms integrations If the team needs to change the upstream workflow platform’s CORS behavior, that remains work for the platform configuration or maintainers; this application design does not patch n8n, Activepieces, or Dify internals.
Build prompt
Use this prompt to scaffold the application in Atoms. Choose one backend for the project: Atoms Cloud or Supabase.
Copy the build brief and use it to create your version in Atoms.
For a private review interface, see how to build a client portal.