I successfully created a ChatGPT Slack bot that responds in as a thread reply to the prompt sent in a specific Slack channel. I’d like ChatGPT to store memory of all messages in that Slack thread so a user can reply in the thread to continue the conversation from the original prompt. What do I add in the Memory Key Field of the Zap to allow the same ChatGPT thread to continue in the Slack thread? I tried using Ts. from the original Slack message but that doesn’t seem to work (see screenshot).
Hey
Hmm, I wonder if it’s not working because the Ts value selected is the timestamp of the new reply, not the original message that started the thread (parent). In that Memory Key field can you try selecting the Thread Ts field instead? For example:
I’m thinking that Thread Ts field should contain the timestamp for the original message and not the timestamp for the reply in the thread that’s triggering the Zap.
Can you give that a try and let us know if that works as hoped?
Hi
When I go the Memory Key field the only option is to add the Thread Ts for the message that triggered the Zap. Do I need to structure the entire Zap differently to work as I described above?
Pasting a screenshot of the entire Zap here too so you can see bigger picture. Thanks for your help
You’re welcome
Ah I see! Ok, well in that case I think you might want to look at using Paths by Zapier to handle the two situations. I say this as I did some checking and it seems that while the sample data will show a Thread Ts field present for messages that a thread would be created from, when the Zap runs that field would not be present.
So I think you’d want two paths. One that checks if that the Thread Ts field Does not exists (meaning it’s a non-threaded message). And another that checks that the Thread Ts field does Exist (Meaning it’s a reply in an existing thread). For example:
Then in the ChatGPT action on the first Path (Thread Ts field Does not exists) you’d set the Memory Key to be the Ts field:
And in the subsequent Slack action that posts ChatGPT’s response you’d set the Thread field to use the Ts field from the Slack trigger:
Next, in the ChatGPT action on the second Path (Thread Ts field Exists) you’d set the Memory Key to be the Thread Ts field:
And in the Slack action that posts ChatGPT’s response for that path you’d set the Thread field to use the Thread Ts field from the Slack trigger:
This should ensure that the Zap will only run the first path for new messages posted in the channel. And the second path will only run for replies in a thread and should allow ChatGPT to reference the past conversation of the thread.
VERY IMPORTANT: Make sure you set the trigger for the Zap to not trigger on new bot messages:
Otherwise the messages sent by the Zap will also trigger the Zap and cause an infinite Zap Loop! If the Slack messages aren’t being sent by the Zap as a bot then you’ll need to add a filter after the trigger to ensure the Zap doesn’t run for ChatGPT’s responses.
Hope that helps to get you pointed in the right direction. Let me know if you run into any issues setting that up or have any questions at all. Happy to help further!
Hi Sam,
Thanks so much for the detailed support! I was able to set this up successfully with a slightly different version than you suggested. I added a Formatter step to set a default value. I used the thread_ts value for it, and if there is no thread_ts value available for this message, I set it to use the ts value.
Best,
Clare
Glad I could help
Seems like you’re all squared away for now, but please do reach out to the Community again if you need any further help at all - always happy to assist!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.