Replying to chat messages
Learn how to reply to messages created by an earlier workflow step or in an existing thread.
Chat channel steps can start a new conversation or reply in an existing provider thread. When the parent message was created by the same workflow run, reply to the previous Knock step. When the parent message already exists outside the workflow, provide its message ID instead.
Reply to a previous Knock step
#This is the recommended way to create a reply. Knock uses the earlier step's provider message reference and destination, so you do not need to pass provider IDs or configure the destination again.
In the workflow builder:
- Add a chat channel step after the step that creates the parent message.
- Set Message behavior to Reply to a previous Knock step.
- Select the Parent step.
A step is available as a parent when it:
- Is a previous chat channel step that is reachable on every execution path to the reply.
- Uses the same single Knock channel as the reply step. Channel groups are not supported.
- Resolves to one provider message and destination for the recipient workflow run.
The reply step inherits the exact provider message reference and recipient connection from its parent. If the parent message is queued or scheduled, Knock waits for its provider message reference before attempting the reply.
Reply to an existing thread
#Use this option when the parent message already exists outside the current workflow.
In the workflow builder:
- Set Message behavior to Reply to an existing thread.
- Enter the Parent message ID, usually as a Liquid value from your workflow data.
- For Slack, optionally enter the channel ID in Send to.
The value expected for Parent message ID depends on the provider:
- For Slack, use the parent message timestamp (
ts). Knock sends it to Slack asthread_ts. - For Discord, use the parent Discord message ID.
Configure the destination
#For Slack, Send to accepts a Slack channel ID, usually from workflow data such as {{ data.channel_id }}. Leave it blank to use the recipient's Slack channel connection. In either case, the destination must be the channel that contains the parent message.
For Discord, Knock uses the Discord channel data stored on the recipient. That connection must identify the channel that contains the parent message.
The configured Slack or Discord channel supplies authentication. Do not put a bot token in workflow data or in the destination field.
Slack trigger-data example
#Send the Slack message timestamp and channel ID in the workflow trigger data:
Then configure the Slack step with:
At execution time, Knock renders the destination as a recipient connection equivalent to: