Replying to chat messages
Learn how to reply to messages created by an earlier workflow step or outside Knock.
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. Use an external message ID only when the parent message was created outside the workflow.
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 Slack 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 Slack 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 external message
#Use an external reply when the parent Slack message was created outside the current workflow. You must provide both the parent message ID and the destination containing that message.
In Slack, the Parent message ID is the message timestamp (ts) used as thread_ts when posting the reply. It commonly comes from workflow trigger data:
Select the destination
#For a Slack channel managed through the Knock Slack extension, use Send to to set the destination in one of two ways:
- Select destination. Choose a channel or person from the connected Slack workspace.
- Use channel ID. Provide a Liquid value that renders to a Slack channel ID, such as
{{ data.channel_id }}.
The managed Slack connection supplies authentication. Do not put a Slack bot token in workflow data or in the channel ID field.
If you do not configure a destination override, Knock uses the Slack connections stored on the workflow recipient. That is only appropriate when the stored connection points to the same channel as the external parent message.
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: