Skip to content

Commit 0230b50

Browse files
zhuangjianguoclaude
andcommitted
docs(api): show the screen-flow resume round-trip in the client SDK guide (#3528)
The SDK page's automation example stopped at `trigger()`, which is exactly the gap the issue reports: a reader had no way to learn that `execute()` on a screen flow returns a paused run, or how to finish it. Adds the execute → paused → resume round-trip and `getScreen()` for a client that did not launch the run. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LX9ut3MK3KykE11S9bJmv5
1 parent 2b4b34b commit 0230b50

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

content/docs/api/client-sdk.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,19 @@ await client.i18n.getFieldLabels('account', 'zh-CN');
319319
// Automation — Trigger workflows and automations
320320
await client.automation.trigger('send_welcome_email', { userId });
321321

322+
// Screen flows pause for user input instead of completing. `execute()` returns
323+
// `{ status: 'paused', runId, screen }`; render the screen, then resume the run
324+
// with the collected values. A wizard pauses again for each further step.
325+
const run = await client.automation.execute('convert_lead', { params: { recordId } });
326+
if (run.status === 'paused') {
327+
await client.automation.resume('convert_lead', run.runId, {
328+
inputs: { account_name: 'Radium Labs' },
329+
});
330+
}
331+
// Re-fetch the pending screen when the client did not launch the run itself
332+
// (a page reload, another tab, an inbox):
333+
await client.automation.getScreen('convert_lead', runId);
334+
322335
// Storage — File upload and management
323336
await client.storage.upload(fileData, 'user');
324337
await client.storage.getDownloadUrl('file-123');

0 commit comments

Comments
 (0)