Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d8298ff
Create Slack v2 Test components
js07 Aug 1, 2025
5c46a1f
update pnpm-lock.yaml
js07 Aug 1, 2025
c53df88
fix undefined usersToAdd in Update Group Members action
js07 Aug 4, 2025
76c2578
update pnpm-lock.yaml
js07 Aug 4, 2025
46410b2
List users by their real names in DM dropdowns
js07 Sep 5, 2025
b42e22b
bump slack_v2_test component versions
js07 Sep 5, 2025
fbc9ff9
List users by real names in group DMs in dropdowns
js07 Sep 7, 2025
7dc8ef0
rename and separate userNameLookup and realNameLookup methods
js07 Sep 7, 2025
9a61fa5
use bot token to get or list files
js07 Sep 14, 2025
a1acbfb
Add addToChannel prop to message-based triggers
js07 Sep 15, 2025
5da889a
specify app will be added to non-DM channels only in prop description
js07 Sep 15, 2025
522e2ea
omit suggestion to set "Send as User" unless using a 'chat' method
js07 Sep 15, 2025
0f6e268
check that bot info is valid
js07 Sep 15, 2025
94e599d
open conversation as the bot when sending message as bot
js07 Sep 15, 2025
73291ee
add `addToChannel` prop to relevant components
js07 Sep 16, 2025
9e9265f
add missing addToChannel prop to Get File
js07 Sep 16, 2025
1b03ec1
ensure the user is in the specified
js07 Sep 16, 2025
f20fe75
show warning in New Direct Message if user is missing im:history scope
js07 Sep 16, 2025
7ea15cc
handle error getting message in New Reaction Added source
js07 Sep 16, 2025
b2fa028
delete verify-slack-signature action
js07 Sep 16, 2025
37ab8cc
add addToChannel prop to missing actions
js07 Sep 16, 2025
57ed109
fix channel membership checks in
js07 Sep 16, 2025
5d65cf8
refactor channel membership check
js07 Sep 16, 2025
fc2a976
reordered addToChannel prop in New Keyword Mention trigger
js07 Sep 16, 2025
9750955
only list channels in Get File and List File actions
js07 Sep 23, 2025
ccf5e54
only list channels in List Replies action
js07 Sep 23, 2025
cadbefd
move addToChannel prop to common Send Message file
js07 Sep 23, 2025
74cb0d0
remove addToChannel option from components that no longer need it
js07 Sep 23, 2025
f58c403
delete the New Direct Message trigger
js07 Sep 23, 2025
8aeb7f5
Only list channels (not DMs) in New Message in Channels trigger
js07 Sep 23, 2025
dae30f1
fixes
js07 Sep 26, 2025
50591a2
bump versions
js07 Sep 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nodejs 20.13.1
nodejs 18.17.0
pnpm 9.14.2
python 3.11.5
poetry 1.6.1
83 changes: 83 additions & 0 deletions components/slack_v2_test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Overview

The Pipedream Slack app enables you to build event-driven workflows that interact with the Slack API. Once you authorize the Pipedream app's access to your workspace, you can use [Pipedream workflows](/workflows/) to perform common Slack [actions](#workflow-actions) or [write your own code](/code/) against the Slack API.

The Pipedream Slack app is not a typical app. You don't interact with it directly as a bot, and it doesn't add custom functionality to your workspace out of the box. It makes it easier to automate anything you'd typically use the Slack API for, using Pipedream workflows.

- Automate posting updates to your team channels
- Create a bot to answer common questions
- Integrate with your existing tools and services
- And much more!

# Getting Started

## Should I use the Slack or Slack Bot app on Pipedream?

The Slack app is the easiest and most convenient option to get started. It installs the official Pipedream bot into your Slack workspace with just a few clicks.

However, if you'd like to use your own bot registered with the [Slack API](https://api.slack.com), you can use the [Slack Bot app](https://pipedream.com/apps/slack-bot) instead.

The Slack Bot requires a bot token to allow your Pipedream workflows to authenticate as your bot. The extra setup steps allow you to list your custom bot on the Slack Marketplace or install the bot on other workspaces as your bot's name instead of as Pipedream.

## Accounts

1. Visit [https://pipedream.com/accounts](https://pipedream.com/accounts).
2. Click on the **Click Here To Connect An App** button in the top-right.
3. Search for "Slack" among the list of apps and select it.
4. This will open a new window asking you to allow Pipedream access to your Slack workspace. Choose the right workspace where you'd like to install the app, then click **Allow**.
5. That's it! You can now use this Slack account in any [actions](#workflow-actions) or [link it to any code step](/connected-accounts/#connecting-accounts).

## Within a workflow

1. [Create a new workflow](https://pipedream.com/new).
2. Select your trigger (HTTP, Cron, etc.).
3. Click the **+** button below the trigger step and search for "Slack".
4. Select the **Send a Message** action.
5. Click the **Connect Account** button near the top of the step. This will prompt you to select any existing Slack accounts you've previously authenticated with Pipedream, or you can select a **New** account. Clicking **New** opens a new window asking you to allow Pipedream access to your Slack workspace. Choose the right workspace where you'd like to install the app, then click **Allow**.
6. After allowing access, you can connect to the Slack API using any of the Slack actions within a Pipedream workflow.

# Example Use Cases

- **Automated Standup Reports**: Trigger a workflow on Pipedream to collect standup updates from team members within a Slack channel at a scheduled time. The workflow compiles updates into a formatted report and posts it to a designated channel or sends it via email using an app like SendGrid.

- **Customer Support Ticketing**: Use Pipedream to monitor a Slack support channel for new messages. On detecting a message, the workflow creates a ticket in a customer support platform like Zendesk or Jira. It can also format and forward critical information back to the Slack channel to keep the team updated.

- **Real-time CRM Updates**: Configure a Pipedream workflow to listen for specific trigger words in sales-related Slack channels. When mentioned, the workflow fetches corresponding data from a CRM tool like Salesforce and posts the latest deal status or customer information in the Slack conversation for quick reference.


# Troubleshooting

## Error Responses

Slack's API will always return JSON, regardless if the request was successfully processed or not.

Each JSON response includes an `ok` boolean property indicating whether the action succeeded or failed.

Example of a successful response:

```json
{
"ok": true
}
```

If the `ok` property is false, Slack will also include an `error` property with a short machine-readable code that describes the error.

Example of a failure:
```json
{
"ok": false,
"error": "invalid_parameters"
}
```

Additionally, if the action is successful, there's still a chance of a `warning` property in the response. This may contain a comma-separated list of warning codes.

Example of a successful response, but with warnings:

```json
{
"ok": true,
"warnings": "invalid_character_set"
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import slack from "../../slack_v2_test.app.mjs";

export default {
key: "slack_v2_test-add-emoji-reaction",
name: "Add Emoji Reaction",
description: "Add an emoji reaction to a message. [See the documentation](https://api.slack.com/methods/reactions.add)",
version: "0.0.3",
type: "action",
props: {
slack,
conversation: {
propDefinition: [
slack,
"conversation",
],
description: "Channel where the message to add reaction to was posted.",
},
timestamp: {
propDefinition: [
slack,
"messageTs",
],
description: "Timestamp of the message to add reaction to. e.g. `1403051575.000407`.",
},
icon_emoji: {
propDefinition: [
slack,
"icon_emoji",
],
description: "Provide an emoji to use as the icon for this reaction. E.g. `fire`",
optional: false,
},
},
async run({ $ }) {
const response = await this.slack.addReactions({
channel: this.conversation,
timestamp: this.timestamp,
name: this.icon_emoji,
});
$.export("$summary", `Successfully added ${this.icon_emoji} emoji reaction.`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import slack from "../../slack_v2_test.app.mjs";
import constants from "../../common/constants.mjs";

export default {
key: "slack_v2_test-approve-workflow",
name: "Approve Workflow",
description: "Suspend the workflow until approved by a Slack message. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun#flowsuspend)",
version: "0.1.2",
type: "action",
props: {
slack,
channelType: {
type: "string",
label: "Channel Type",
description: "The type of channel to send to. User/Direct Message (im), Group (mpim), Private Channel or Public Channel",
async options() {
return constants.CHANNEL_TYPE_OPTIONS;
},
},
conversation: {
propDefinition: [
slack,
"conversation",
(c) => ({
types: c.channelType === "Channels"
? [
constants.CHANNEL_TYPE.PUBLIC,
constants.CHANNEL_TYPE.PRIVATE,
]
: [
c.channelType,
],
}),
],
},
message: {
type: "string",
label: "Message",
description: "Text to include with the Approve and Cancel Buttons",
},
},
async run({ $ }) {
const {
resume_url, cancel_url,
} = $.flow.suspend();

const response = await this.slack.postChatMessage({
text: "Click here to approve or cancel workflow",
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: this.message,
},
},
{
type: "actions",
elements: [
{
type: "button",
text: {
type: "plain_text",
text: "Approve",
},
style: "primary",
url: resume_url,
},
{
type: "button",
text: {
type: "plain_text",
text: "Cancel",
},
style: "danger",
url: cancel_url,
},
],
},
],
channel: this.conversation,
});

$.export("$summary", "Successfully sent message");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import slack from "../../slack_v2_test.app.mjs";
import constants from "../../common/constants.mjs";

export default {
key: "slack_v2_test-archive-channel",
name: "Archive Channel",
description: "Archive a channel. [See the documentation](https://api.slack.com/methods/conversations.archive)",
version: "0.0.3",
type: "action",
props: {
slack,
conversation: {
propDefinition: [
slack,
"conversation",
() => ({
types: [
constants.CHANNEL_TYPE.PUBLIC,
constants.CHANNEL_TYPE.PRIVATE,
constants.CHANNEL_TYPE.MPIM,
],
}),
],
},
},
async run({ $ }) {
const response = await this.slack.archiveConversations({
channel: this.conversation,
});
$.export("$summary", "Successfully archived channel.");
return response;
},
};
Loading
Loading