diff --git a/_snippets/components/integrations/slack-tool-steps.mdx b/_snippets/components/integrations/slack-tool-steps.mdx index e49d9322..baf401b3 100644 --- a/_snippets/components/integrations/slack-tool-steps.mdx +++ b/_snippets/components/integrations/slack-tool-steps.mdx @@ -2,6 +2,9 @@ Use a Tool step to send a message to your Slack channel. + + Use a Tool step to edit a previously sent Slack message in place. + Use a Tool step to retrieve messages from one of your Slack channels. diff --git a/build/tools/tool-steps/slack/send-message.mdx b/build/tools/tool-steps/slack/send-message.mdx index 6624e0af..aa646c02 100644 --- a/build/tools/tool-steps/slack/send-message.mdx +++ b/build/tools/tool-steps/slack/send-message.mdx @@ -4,7 +4,7 @@ sidebarTitle: "Send Message" description: "Send a message to a Slack channel from Relevance AI" --- -The 'Slack - Send Message' Tool step allows you to send a message to one of your Slack channels from Relevance AI. +The 'Slack - Send Message' Tool step allows you to send a message to one of your Slack channels from Relevance AI. Both the standard and advanced variants of this step return the same outputs. You can learn more about the Slack integration [here](/integrations/popular-integrations/slack). @@ -23,4 +23,33 @@ You can add the 'Slack - Send Message' Tool step to your Tool by: 2. Click 'Expand' to see the full Tool step 3. Select the Slack channel you want to send the message to 4. Add your message in the 'Message' field -5. Click 'Run step' to test out your Tool step \ No newline at end of file +5. Click 'Run step' to test out your Tool step + +## Outputs + +After the message is sent, this Tool step returns two values you can reference in later steps: + +| Output | Description | +|--------|-------------| +| `ts` | The timestamp identifier of the sent message | +| `channel` | The ID of the channel where the message was sent | + +Wire these outputs into a subsequent [Slack - Update Message](/build/tools/tool-steps/slack/update-message) step to edit the same message in place — for example, to show progress as a multi-step task completes. + + +This pattern sends one status message at the start of a run, then edits it as each task completes. + +**Send Message step** — posts the initial checklist: +- Message: `Task progress:\n⬜ Step 1\n⬜ Step 2\n⬜ Step 3` +- Outputs: `ts` and `channel` are saved for use in later steps + +**Update Message step** (after Step 1 completes): +- Channel: reference the `channel` output from the Send Message step +- Timestamp: reference the `ts` output from the Send Message step +- Text: `Task progress:\n✅ Step 1\n⬜ Step 2\n⬜ Step 3` + +**Update Message step** (after Step 2 completes): +- Text: `Task progress:\n✅ Step 1\n✅ Step 2\n⬜ Step 3` + +Each Update Message step edits the same original message rather than posting new replies, keeping the Slack channel tidy. + \ No newline at end of file diff --git a/build/tools/tool-steps/slack/update-message.mdx b/build/tools/tool-steps/slack/update-message.mdx new file mode 100644 index 00000000..0cd57a6b --- /dev/null +++ b/build/tools/tool-steps/slack/update-message.mdx @@ -0,0 +1,61 @@ +--- +title: "'Slack - Update Message' Tool step" +sidebarTitle: "Update Message" +description: "Edit a previously sent Slack message in place using Relevance AI" +--- + +The 'Slack - Update Message' Tool step lets you edit the content of a previously sent Slack message. Use it together with the [Slack - Send Message](/build/tools/tool-steps/slack/send-message) step to update a message in place — for example, to show progress as a multi-step task completes. + +You can learn more about the Slack integration [here](/integrations/popular-integrations/slack). + +This integration for Slack was developed by our team and is not affiliated with Slack. Please contact our Support for any questions/queries you may have. + +## Inputs + +Two inputs identify which message to edit: + +| Input | Required | Description | +|-------|----------|-------------| +| `channel` | Yes | The ID of the channel containing the message. Use the `channel` output from a Send Message step. | +| `ts` | Yes | The timestamp identifier of the message to edit. Use the `ts` output from a Send Message step. | + +At least one of the following must be provided to set the new content: + +| Input | Required | Description | +|-------|----------|-------------| +| `text` | No | The new plain-text or mrkdwn content for the message | +| `blocks` | No | A [Block Kit](https://api.slack.com/block-kit) JSON array for richer message layouts | +| `attachments` | No | A JSON array of legacy Slack message attachments | + +## Add the 'Slack - Update Message' Tool step to your Tool + +1. Create a new Tool, then search for the 'Slack: Update Message' Tool step +2. Click 'Expand' to see the full Tool step +3. Set the **Channel** field to the `channel` output from a preceding Send Message step +4. Set the **Timestamp** field to the `ts` output from a preceding Send Message step +5. Enter your updated message content in the **Text** field, or supply a Block Kit JSON array in the **Blocks** field +6. Click 'Run step' to test + +## Updating a message in place + +Wire the `ts` and `channel` outputs from a [Send Message](/build/tools/tool-steps/slack/send-message) step directly into this step's inputs. Each time the Update Message step runs, it overwrites the content of that specific message — no new message is posted to the channel. + + +This pattern sends one status message at the start of a Tool run and edits it as each task completes, keeping the Slack channel tidy. + +**Send Message step** — posts the initial checklist: +- Message: `Task progress:\n⬜ Step 1\n⬜ Step 2\n⬜ Step 3` +- Outputs `ts` and `channel` for use in subsequent steps + +**Update Message step** (runs after Step 1 completes): +- Channel: reference the `channel` output from the Send Message step +- Timestamp: reference the `ts` output from the Send Message step +- Text: `Task progress:\n✅ Step 1\n⬜ Step 2\n⬜ Step 3` + +**Update Message step** (runs after Step 2 completes): +- Channel: reference the `channel` output from the Send Message step +- Timestamp: reference the `ts` output from the Send Message step +- Text: `Task progress:\n✅ Step 1\n✅ Step 2\n⬜ Step 3` + +Each Update Message step edits the same original message rather than posting new replies. + diff --git a/docs.json b/docs.json index ddf85285..47ed9e9b 100644 --- a/docs.json +++ b/docs.json @@ -301,6 +301,7 @@ "group": "Slack Tool Steps", "pages": [ "build/tools/tool-steps/slack/send-message", + "build/tools/tool-steps/slack/update-message", "build/tools/tool-steps/slack/retrieve-messages" ] },