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

Don’t hardcode the channel ID value in step 6; instead, use the channel ID data pill from step 4 in Flow Designer to ensure your reply is posted in the correct thread.

When i click on the data pill of channel id, this is how it looks:

aakankshapl_0-1758370463465.png

 

@aakankshapl,

Step‑by‑step in Flow Designer

1) Post the initial message

  • Action: Slack → Post Message
  • Inputs: Select your Slack connection; set Channel (by name or ID) and Text.
  • Outputs to keep:
    • Channel ID (from the action’s outputs)
    • Message timestamp (Slack ts) — this becomes your thread id (thread_ts) for the next post.

    Slack threads are keyed by the parent message’s ts. You’ll reuse it as thread_ts in the follow‑up step.

2) Wait for two hours

  • Flow logic: Wait for a duration → Explicit duration = 2 hours
    • Notes: Flow Designer’s Wait for a duration supports explicit/relative waits (up to 999 hours) and the actual firing time can vary slightly due to engine processing. That’s normal.

3) Post the follow‑up in the same thread

You have two straightforward options depending on your Slack Spoke version:

Use a “Thread timestamp” input (if present in your Post Message action)

  • Action: Slack → Post Message
  • Channel: Use the Channel ID from Step 1 outputs
  • Thread timestamp: Use the Message timestamp (ts) from Step 1 outputs
  • Text: Your follow‑up message

@SP22 

Where to use that Thread timestamp in 2nd post message action as they only asking Channel id,  message, block, username and icon.

Also can you please guide me on how to keep output:

  • Channel ID (from the action’s outputs)
  • Message timestamp (Slack ts) — this becomes your thread id (thread_ts) for the next post.

It will be a lot of help if this work, I am working on this from last week.
I appreciate your help!

 




kaushal_snow
Giga Sage

Hi @aakankshapl ,

 

Capture the Slack channel ID and message timestamp (ts) when you post the first message in Flow Designer, save those (for example on the incident record), then when you need to post the follow up after 2 hours use that same channel ID and pass the saved thread_ts (timestamp) in the Slack spoke Post Message action so that message appears in the thread of the first one....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/