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

SP22
Giga Sage

@aakankshapl,

https://www.youtube.com/watch?v=WzK1Ph49YHg

If this helped to answer your query, please mark it helpful & accept the solution.

Thanks
Santosh.p

In this video i have explained step by step configuration for slack integration in ServiceNow. What all details you should ask from your customer before starting slack integration. where and how you can do the configuration in servicenow and how to exchange chat from incident to slack and vise ...

I checked this full video but it doesnt include how to post slack thread message.

@aakankshapl

In Flow Designer, you can use data pills to reference and manipulate data from previous steps, allowing you to combine or transfer values such as channel IDs between actions seamlessly.

Have you tried using a data pill to add the first channel ID to the second channel ID

I have added a channel id of previous message  channel id hardcoded as both are same,  the 6th step is posting my message on the slack channel but not on thread of previous msg