Slack provides built-in functions you can use alongside your custom functions in a workflow. Built-in functions are essentially Slack-native actions, like creating a channel or sending a message, that work hand-in-hand with your functions.
Built-in functions BETA
Using with workflows
Built-in functions need to be imported from the standard library built into the SDK — all built-in functions are children of the Schema.slack.functions
object. Just like custom functions, built-ins are then added to steps in a workflow using the addStep
method. That’s it!
Built-in functions define their own inputs and outputs, as detailed for each built-in below.
Here’s an example of a workflow that sends a message using the SendMessage
built-in function:
1
2
3
4
5
6
7
8
9
10
const { DefineWorkflow, Schema } = require('@slack/bolt');
...
SampleWorkflow.addStep(Schema.slack.functions.SendMessage, {
channel_id: inputForm.outputs.fields.channel,
message: greetingFunctionStep.outputs.greeting,
});
module.exports = { SampleWorkflow };
Read the full documentation for workflows to learn how to build out workflows.
Built-in functions list
You can view a full list of built-in functions here.
Next steps
Now that you’ve taken a dive into built-in functions, you can explore custom functions and what they have to offer. ✨