megachangelog
Feature

Pause workflows for approval with Chat SDK

Chat SDK now supports human-in-the-loop approvals through a new requestApproval method that posts a card with Approve and Deny buttons and suspends workflow execution until a decision is made. The wait can last any duration and survives deploys and restarts, with support for scoped approvers, verified decisions, and an audit trail.

You can build human-in-the-loop approvals with Chat SDK through the new subpath. One call posts a card with Approve and Deny buttons and suspends a workflow until someone decides.chat/workflowrequestApprovalWorkflow SDK

The wait can last seconds or days and survives deploys and restarts. You don't need an approvals table, an handler, or a polling loop:onAction

Start the workflow from any handler, and instances serialize across the workflow boundary automatically. The card handles the rest:Thread

Get started by reading the .approvals documentation

Read more

  • Pass to restrict who can decide. Clicks from anyone else post a notice, and the workflow keeps waiting.Scoped approvers: approvers

  • Chat SDK checks the platform's signature on every click, so the on the result is the person who decided.Verified decisions: user.id

  • Once a decision lands or the timeout elapses, the card is edited in place with an outcome line, preventing stale clicks.Audit trail:

chat-sdkworkflowsapprovalshuman-in-the-loop

Source: original entry ↗