Integrations
Chat
Replying to chat messages

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 to an existing provider thread. When a parent message was created by the current workflow run, you can send a reply to a previous chat step. To reply to a message that already exists outside the workflow run, you'll provide its provider identifiers instead.

Reply to a previous chat step

#

This is the recommended way to create a reply. Knock uses the earlier workflow 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:

  1. Add a chat channel step after the step that creates the parent message.
  2. Set Message behavior to Reply to a previous chat step.
  3. 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. Chat steps inside conditional branches will not be eligible as a parent to subsequent steps outside of that branch.
  • Uses the same single Knock channel as the reply step. Channel groups are not supported.
  • Resolves to one provider message and destination for the current recipient workflow run. A chat step that creates multiple messages, such as when a recipient has multiple channel connections, is not eligible as a parent.

The reply step inherits the exact provider message reference and recipient connection from its parent. For Microsoft Teams, Knock keeps the original thread root when the selected parent step is itself a reply. 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 of the current workflow run.

In the workflow builder:

  1. Set Message behavior to Reply to an existing thread.
  2. Enter the provider identifiers described below, usually as dynamic Liquid references from your workflow trigger data.
  3. For Slack, optionally enter the channel ID in Send to. See below for more detail on configuring the destination.

The values depend on the provider:

  • For Slack, use the parent message's timestamp (ts). Knock sends it to Slack as thread_ts.
  • For Discord, use the parent Discord message ID.
  • For Microsoft Teams, enter the thread's conversation ID in Conversation ID and the root activity's ID in Thread root message ID. In an incoming Bot Framework activity, these values are conversation.id and id.

Microsoft Teams replies require a bot-based connection. Incoming webhook connections cannot reply to messages.

Configure the destination

#

For Slack, Send to accepts a Slack channel ID, usually from workflow trigger 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.

For Microsoft Teams, Knock resolves a bot-based connection from the recipient and, when used, tenant channel data. Together, the channel data must include a Microsoft Entra tenant ID and either a Microsoft Teams channel ID or user ID. See Microsoft Teams channel data requirements.

The configured Slack, Discord, or Microsoft Teams channel supplies authentication. Do not put a bot token in workflow data or in a 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:

SettingValue
Message behaviorReply to an existing thread
Parent message ID{{ data.parent_message_id }}
Send to{{ data.channel_id }}

At execution time, Knock renders the destination as a recipient connection equivalent to:

Microsoft Teams trigger data example

#

Send the conversation ID and root activity ID in the workflow trigger data:

Then configure the Microsoft Teams step with:

SettingValue
Message behaviorReply to an existing thread
Conversation ID{{ data.conversation_id }}
Thread root message ID{{ data.thread_root_message_id }}

The conversation and thread root identifiers select the existing Microsoft Teams thread. The recipient and tenant channel data provide the bot connection that Knock uses to send the reply.

Troubleshooting

#

Knock uses the recipient's stored Slack connection, which might point to another channel. Enter the channel ID that contains the parent message.

The reply does not attach to the expected thread, or Slack rejects the request. Enter the channel ID that contains the parent message.

Microsoft Teams rejects the reply or cannot attach it to the expected thread. Use the conversation.id and root activity id from the Microsoft Teams Bot Framework activity.

Knock cannot reply because incoming webhooks do not provide the required bot-based connection. Configure bot-based channel data for the provider.

Knock cannot render a required provider identifier or destination, so it does not send the reply. Verify the workflow trigger data and Liquid path.

The step is not guaranteed to run first, uses another Knock channel, or is inside an unsupported group. Adjust the workflow graph or reply to an existing thread with its provider identifiers.

Knock cannot identify one parent message and destination when the step produces no message or multiple messages. Make the parent resolve to exactly one chat message for the recipient run.

New chat