Slack functions are essentially Slack-native actions, like creating a channel or sending a message. Use them alongside your custom functions in a workflow. Browse our inventory of Slack functions.
Slack functions need to be imported from the standard library built into the Slack SDK—all Slack functions are children of the Schema.slack.functions
object. Just like custom functions, Slack functions can be added to steps in a workflow using the addStep
method.
Slack functions define their own inputs and outputs, as detailed for each Slack function in the catalog below.
The details for each Slack function can be found in our reference documentation.
Channel management
archive_channel
- Archive a Slack channelcreate_channel
- Create a Slack channelinvite_user_to_channel
- Invite someone to a channel.update_channel_topic
- Update the topic of a specific channel.Helpers
Interactivity
Messaging
reply_in_thread
- Reply to a message by creating or adding to a threadsend_dm
- Send a direct message to someonesend_ephemeral_message
- Send a private message to someone in a channelsend_message
- Send a messagePinned items
User management
Here's an example of a workflow that creates a new Slack channel using the CreateChannel
Slack function:
import { DefineWorkflow, Schema } from "deno-slack-sdk/mod.ts";
// Define a workflow that can pass the parameters for the Slack function
const myWorkflow = DefineWorkflow({
callback_id: "channel-creator",
title: "Channel Creator",
input_parameters: {
properties: { channel_name: { type: Schema.types.string } },
required: ["channel_name"],
},
});
const createChannelStep = myWorkflow.addStep(
Schema.slack.functions.CreateChannel,
{
channel_name: myWorkflow.inputs.channel_name,
is_private: false,
},
);
export default myWorkflow;
➡️ To learn how to add a Slack function to a workflow, head to the workflows section.
✨ To learn how to create your own custom functions, head to the custom functions section.