Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to post slack message in thread of previous message on the channel? Flow designer

aakankshapl
Tera Guru

Hello all,

We have created a flow using slack scope where we are posting a message in slack channel so after waiting of 2 hours another message should get post on previous message thread on the same channel.

Please help me on this!!!
Thank you in advance.

aakankshapl_0-1758365579788.png

aakankshapl_1-1758365806800.png

aakankshapl_3-1758366048764.png

 

 

1 ACCEPTED SOLUTION

aakankshapl
Tera Guru

Hello 

Posting the step by step guide on how to post the thread message on slack, if this help you please mark as helpfull. ✔️

Step 1: 
Create a copy of the original "Post Message" action in Flow Designer.
Step 2: Add a new input variable in the action called timestamp (this will hold Slack's ts value).
Update the Create Payload script to include this input if provided:

aakankshapl_0-1764331985671.png

aakankshapl_1-1764332058464.png

 

 

aakankshapl_2-1764332120020.png

 

Step 3: In Post Processing, add logic to capture Slack's response and extract the ts:

aakankshapl_3-1764332235038.png

 

Step 4: Create an output variable in Post Processing called message_ts.

aakankshapl_4-1764332294179.png

 

Step 5: Add this output variable (ts) to the action's Outputs section so it can be used in flows.

aakankshapl_5-1764332356944.png

 

Step 6: When posting the first message, capture:

  • Slack Channel ID
  • Message Timestamp (ts)

Store these values (e.g., on the Incident record).
When posting a follow-up message after 2 hours, use:

  • The same channel ID
  • The saved thread_ts (timestamp) in your copied Post Message action
    This ensures the follow-up message appears in the same thread.

This new action will allow you to post messages in Slack threads using Flow Designer.

 

aakankshapl_6-1764332653415.png

 

💡Please mark my answer correct and helpful if this works for you ✔️

Thanks and Regards,
Aakanksha

 

View solution in original post

13 REPLIES 13

@kaushal_snow
For now I updated my task record manulay with one of my previous message time stamp and added use that timestamp on the message by using data pill. Still the message is posting individually and not as thread.
Please help me with this!!

aakankshapl_3-1758382299948.png

aakankshapl_1-1758382151546.png

 

nityabans27
Kilo Patron

@aakankshapl,

Steps in Flow Designer

  1. Trigger → Event of your choice (e.g., Incident Created).

  2. Action 1Slack – Post Message to Channel

    • Input: Channel, Message text.

    • Capture output: ts (message timestamp).

  3. Flow LogicWait

    • Duration: 2 hours.

  4. Action 2Slack – Post Message to Channel

    • Input: Same Channel.

    • Message text: Follow-up content.

    • Advanced input: thread_ts = ts from Action 1 output.


Key Notes

  • Without thread_ts, message will post as a new thread.

  • Ensure Slack app has chat:write scope for both channels and threads.

  • Add error handling in case Action 1 fails (no ts available).

@nityabans27 

In this 2nd action can you tell me where to use the thread_ts

aakankshapl_0-1758436829386.png

 

aakankshapl
Tera Guru

Hello 

Posting the step by step guide on how to post the thread message on slack, if this help you please mark as helpfull. ✔️

Step 1: 
Create a copy of the original "Post Message" action in Flow Designer.
Step 2: Add a new input variable in the action called timestamp (this will hold Slack's ts value).
Update the Create Payload script to include this input if provided:

aakankshapl_0-1764331985671.png

aakankshapl_1-1764332058464.png

 

 

aakankshapl_2-1764332120020.png

 

Step 3: In Post Processing, add logic to capture Slack's response and extract the ts:

aakankshapl_3-1764332235038.png

 

Step 4: Create an output variable in Post Processing called message_ts.

aakankshapl_4-1764332294179.png

 

Step 5: Add this output variable (ts) to the action's Outputs section so it can be used in flows.

aakankshapl_5-1764332356944.png

 

Step 6: When posting the first message, capture:

  • Slack Channel ID
  • Message Timestamp (ts)

Store these values (e.g., on the Incident record).
When posting a follow-up message after 2 hours, use:

  • The same channel ID
  • The saved thread_ts (timestamp) in your copied Post Message action
    This ensures the follow-up message appears in the same thread.

This new action will allow you to post messages in Slack threads using Flow Designer.

 

aakankshapl_6-1764332653415.png

 

💡Please mark my answer correct and helpful if this works for you ✔️

Thanks and Regards,
Aakanksha