-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: document custom step usage #1125
Conversation
@@ -0,0 +1,86 @@ | |||
--- | |||
title: Listening and responding to custom steps | |||
lang: ja-jp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need some help for the translation 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, my only suggestion would be to link to api.slack.com docs around custom steps for bolt usage in the introductory sentence(s), linking to Haley's work recently where possible.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1125 +/- ##
=======================================
Coverage 91.80% 91.80%
=======================================
Files 186 186
Lines 6408 6408
=======================================
Hits 5883 5883
Misses 525 525 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super solid lift here, thank you tons! 💪 🥇 🎉
Sharing similar suggestions as in slackapi/bolt-js#2198 that I think are worth considering before merging, and I think some of the updates @filmaj suggested to the "interactivity" section in that PR would be nice to include here too!
docs/content/basic/custom-steps.md
Outdated
def sample_step_callback(inputs: dict, ack: Ack, fail: Fail, complete: Complete): | ||
try: | ||
ack() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def sample_step_callback(inputs: dict, ack: Ack, fail: Fail, complete: Complete): | |
try: | |
ack() | |
def sample_step_callback(inputs: dict, fail: Fail, complete: Complete): | |
try: |
Calling ack
seems to be valid here but I don't think it's necessary 🤔 Please correct me if this is wrong though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep it in the docs, there are a number of issues opened related to calling ack
before executing custom logic
Keeping it in hopes that it will help developers avoid a bug 🙏
slug: /concepts/custom-steps | ||
--- | ||
|
||
Your app can use the `function()` method to listen to incoming [custom step requests](https://api.slack.com/automation/functions/custom-bolt). Custom steps are used in Workflow Builder to build workflows. The method requires a step `callback_id` of type `str`. This `callback_id` must also be defined in your [Function](https://api.slack.com/concepts/manifests#functions) definition. Custom steps must be finalized using the `complete()` or `fail()` listener arguments to notify Slack that your app has processed the request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your app can use the `function()` method to listen to incoming [custom step requests](https://api.slack.com/automation/functions/custom-bolt). Custom steps are used in Workflow Builder to build workflows. The method requires a step `callback_id` of type `str`. This `callback_id` must also be defined in your [Function](https://api.slack.com/concepts/manifests#functions) definition. Custom steps must be finalized using the `complete()` or `fail()` listener arguments to notify Slack that your app has processed the request. | |
Your app can use the `function()` listener to listen to incoming [custom step requests](https://api.slack.com/automation/functions/custom-bolt). | |
Adding a custom step starts with a definition in [the app manifest](https://api.slack.com/concepts/manifests#functions) and a `function()` listener listening for the `callback_id` of that function. Upon function execution the listener is called and can run whatever code, but must finish with either the `complete()` or `fail()` listener argument to end the step: |
Same suggestion as slackapi/bolt-js#2198 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the documentation uses the method
terminology instead of the listener
I think its better to be consistent and stick to method
We can send a follow up PR to update all the terms 👍
This PR aims to provide documentation for
custom step
usage in the bolt frameworkTesting
cd ./docs
npm install
npm start
Category
slack_bolt.App
and/or its core componentsslack_bolt.async_app.AsyncApp
and/or its core componentsslack_bolt.adapter
/docs
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.sh
after making the changes.