ByteChef LogoByteChef
PlatformAutomationBuildAI HubWorkflow Chats

Advanced Behavior

Questions and approvals inside a chat, embedded chat interfaces, and the current limits of workflow chats.

Questions and approvals inside a chat

A workflow turn does not have to be a single request and response. A workflow can pause mid-run and resume after the user responds, inside the same conversation:

  • Questions - When an AI Agent asks the user a question, the chat shows the question. The user's next message is sent as the answer, and the run resumes.
  • Approvals - When the run reaches an approval step, the chat shows an approval card. The user approves or rejects it in the chat.

This uses the suspend and resume mechanism described in Human in the Loop.

A chat can pause a run only when the reply is streamed. If the workflow has no streaming step after the pausing step, the chat shows an error that says the chat cannot pause the run for an approval or wait step. Add a streaming step, such as an AI Agent, after it.

Embedded chat

Setting the trigger's Mode to Embedded Chat removes the workflow from the Chats page. Your own interface calls the workflow's webhook with the same message, conversationId, and attachments fields and renders the reply. The workflow logic is the same in both modes; only the front end differs. The @bytechef/chat widget provides a ready-made front end.

For example, this request sends one turn with an attached file, the same way the hosted chat does. Reuse the same conversationId on the next turn to continue the conversation:

curl -X POST "https://<your-host>/webhooks/<webhook-id>" \
  -F "conversationId=c3f1a6e0-2b7d-4f0e-9a51-0c8e2d4b7a19" \
  -F "message=Where is my order A-1001?" \
  -F "attachments=@invoice.pdf"

In the workflow, the fields are ${trigger_1.message}, ${trigger_1.conversationId} and ${trigger_1.attachments}. Append /sse to the URL to receive the reply as a stream.

Limitations

  • The chat trigger runs synchronously. A turn occupies the chat until the workflow returns. Design workflows so that a turn completes in a reasonable time, and stream output for long answers.
  • Access follows the workspace. A user who can open the Chats page in a workspace can run every hosted chat workflow deployed there in the selected environment.
  • Conversations are environment-isolated. A conversation runs against the environment and deployed workflow version it started in.
  • Hosted conversations are not stored. The Chats page keeps conversations in the browser only, until you leave or reload the page.

Keep turns responsive

If a chat is slow, stream partial output early in the workflow and defer heavy work, so the user sees progress. See Streamed replies.

How is this guide?

Last updated on

On this page