Skip to content
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

chore: purge the "workflow step" terminology #2199

Merged
merged 7 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/content/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Below is the current list of methods that accept listener functions. These metho
| `app.action(actionId, fn);` | Listens for an action event from a Block Kit element, such as a user interaction with a button, select menu, or datepicker. The `actionId` identifier is a `string` that should match the unique `action_id` included when your app sends the element to a view. Note that a view can be a message, modal, or app home. Note that action elements included in an `input` block do not trigger any events.
| `app.shortcut(callbackId, fn);` | Listens for global or message shortcut invocation. The `callbackId` is a `string` or `RegExp` that must match a shortcut `callback_id` specified within your app's configuration.
| `app.view(callbackId, fn);` | Listens for `view_submission` and `view_closed` events. `view_submission` events are sent when a user submits a modal that your app opened. `view_closed` events are sent when a user closes the modal rather than submits it.
| `app.step(workflowStep)` | Listen and responds to workflow step events using the callbacks passed in an instance of `WorkflowStep`. Callbacks include three callbacks: `edit`, `save`, and `execute`. More information on workflow steps can be found [in the documentation](/concepts/adding-editing-steps).
| `app.step(workflowStep)` | Listen and responds to steps from apps events using the callbacks passed in an instance of `WorkflowStep`. Callbacks include three callbacks: `edit`, `save`, and `execute`. More information on steps from apps can be found [in the documentation](/concepts/adding-editing-steps).
| `app.command(commandName, fn);` | Listens for slash command invocations. The `commandName` is a `string` that must match a slash command specified in your app's configuration. Slash command names should be prefaced with a `/` (ex: `/helpdesk`).
| `app.options(actionId, fn);` | Listens for options requests (from select menus with an external data source). This isn't often used, and shouldn't be mistaken with `app.action`. The `actionId` identifier is a `string` that matches the unique `action_id` included when you app sends a [select with an external data source](https://api.slack.com/reference/block-kit/block-elements#external_select).

Expand Down Expand Up @@ -162,7 +162,7 @@ Bolt includes a set of error types to make errors easier to handle, with more sp
| `ReceiverMultipleAckError` | Error thrown within Receiver when your app calls `ack()` when that request has previously been acknowledged. Currently only used in the default `HTTPReceiver`. |
| `ReceiverAuthenticityError` | Error thrown when your app's request signature could not be verified. The error includes information on why it failed, such as an invalid timestamp, missing headers, or invalid signing secret.
| `MultipleListenerError` | Thrown when multiple errors occur when processing multiple listeners for a single event. Includes an `originals` property with an array of the individual errors. |
| `WorkflowStepInitializationError` | Error thrown when configuration options are invalid or missing when instantiating a new `WorkflowStep` instance. This could be scenarios like not including a `callback_id`, or not including a configuration object. More information on Workflow Steps [can be found in the documentation](/concepts/steps). |
| `WorkflowStepInitializationError` | Error thrown when configuration options are invalid or missing when instantiating a new `WorkflowStep` instance. This could be scenarios like not including a `callback_id`, or not including a configuration object. More information on steps from apps [can be found in the documentation](/concepts/steps). |
| `UnknownError` | An error that was thrown inside the framework but does not have a specified error code. Contains an `original` property with more details. |

:::info
Expand Down
10 changes: 5 additions & 5 deletions docs/content/steps/adding-editing-steps.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
title: Adding or editing workflow steps
title: Adding or editing steps from apps
lang: en
slug: /concepts/adding-editing-steps
---

:::danger

Workflow Steps from Apps are a deprecated feature.
Steps from Apps are a deprecated feature.

Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions).
Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt).

Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information.

:::

When a builder adds (or later edits) your step in their workflow, your app will receive a [`workflow_step_edit` event](https://api.slack.com/reference/workflows/workflow_step_edit). The `edit` callback in your `WorkflowStep` configuration will be run when this event is received.

Whether a builder is adding or editing a step, you need to send them a [workflow step configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title​`, `submit​`, or `close`​ properties. By default, the configuration modal's `callback_id` will be the same as the workflow step.
Whether a builder is adding or editing a step, you need to send them a [step from app configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title​`, `submit​`, or `close`​ properties. By default, the configuration modal's `callback_id` will be the same as the step from app.

Within the `edit` callback, the `configure()` utility can be used to easily open your step's configuration modal by passing in an object with your view's `blocks`. To disable saving the configuration before certain conditions are met, pass in `submit_disabled` with a value of `true`.

Expand Down Expand Up @@ -67,4 +67,4 @@ const ws = new WorkflowStep('add_task', {
save: async ({ ack, step, update }) => {},
execute: async ({ step, complete, fail }) => {},
});
```
```
14 changes: 7 additions & 7 deletions docs/content/steps/creating-steps.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
title: Creating workflow steps
title: Creating steps from apps
lang: en
slug: /concepts/creating-steps
---

:::danger

Workflow Steps from Apps are a deprecated feature.
Steps from Apps are a deprecated feature.

Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions).
Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt).

Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information.

:::

To create a workflow step, Bolt provides the `WorkflowStep` class.
To create a step from app, Bolt provides the `WorkflowStep` class.

When instantiating a new `WorkflowStep`, pass in the step's `callback_id` and a configuration object.

The configuration object contains three properties: `edit`, `save`, and `execute`. Each of these properties must be a single callback or an array of callbacks. All callbacks have access to a `step` object that contains information about the workflow step event.
The configuration object contains three properties: `edit`, `save`, and `execute`. Each of these properties must be a single callback or an array of callbacks. All callbacks have access to a `step` object that contains information about the step from app event.

After instantiating a `WorkflowStep`, you can pass it into `app.step()`. Behind the scenes, your app will listen and respond to the workflow step’s events using the callbacks provided in the configuration object.
After instantiating a `WorkflowStep`, you can pass it into `app.step()`. Behind the scenes, your app will listen and respond to the step’s events using the callbacks provided in the configuration object.

```javascript
const { App, WorkflowStep } = require('@slack/bolt');
Expand All @@ -39,4 +39,4 @@ const ws = new WorkflowStep('add_task', {
});

app.step(ws);
```
```
16 changes: 8 additions & 8 deletions docs/content/steps/executing-steps.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
title: Executing workflow steps
title: Executing steps from apps
lang: en
slug: /concepts/executing-steps
---

:::danger

Workflow Steps from Apps are a deprecated feature.
Steps from Apps are a deprecated feature.

Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions).
Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt).

Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information.

:::

When your workflow step is executed by an end user, your app will receive a [`workflow_step_execute` event](https://api.slack.com/events/workflow_step_execute). The `execute` callback in your `WorkflowStep` configuration will be run when this event is received.
When your step from app is executed by an end user, your app will receive a [`workflow_step_execute` event](https://api.slack.com/events/workflow_step_execute). The `execute` callback in your `WorkflowStep` configuration will be run when this event is received.

Using the `inputs` from the `save` callback, this is where you can make third-party API calls, save information to a database, update the user's Home tab, or decide the outputs that will be available to subsequent workflow steps by mapping values to the `outputs` object.
Using the `inputs` from the `save` callback, this is where you can make third-party API calls, save information to a database, update the user's Home tab, or decide the outputs that will be available to subsequent steps by mapping values to the `outputs` object.

Within the `execute` callback, your app must either call `complete()` to indicate that the step's execution was successful, or `fail()` to indicate that the step's execution failed.

Expand All @@ -38,12 +38,12 @@ const ws = new WorkflowStep('add_task', {
// `await complete()` is not recommended because of the slow response of the API endpoint
// which could result in not responding to the Slack Events API within the required 3 seconds
// instead, use:
// complete({ outputs }).then(() => { console.log('workflow step execution complete registered'); });
// complete({ outputs }).then(() => { console.log('step from app execution complete registered'); });

// let Slack know if something went wrong
// await fail({ error: { message: "Just testing step failure!" } });
// NOTE: If you run your app with processBeforeResponse: true, use this instead:
// fail({ error: { message: "Just testing step failure!" } }).then(() => { console.log('workflow step execution failure registered'); });
// fail({ error: { message: "Just testing step failure!" } }).then(() => { console.log('step from app execution failure registered'); });
},
});
```
```
10 changes: 5 additions & 5 deletions docs/content/steps/saving-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ slug: /concepts/saving-steps

:::danger

Workflow Steps from Apps are a deprecated feature.
Steps from Apps are a deprecated feature.

Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions).
Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt).

Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information.

Expand All @@ -18,8 +18,8 @@ After the configuration modal is opened, your app will listen for the `view_subm

Within the `save` callback, the `update()` method can be used to save the builder's step configuration by passing in the following arguments:

- `inputs` is an object representing the data your app expects to receive from the user upon workflow step execution.
- `outputs` is an array of objects containing data that your app will provide upon the workflow step's completion. Outputs can then be used in subsequent steps of the workflow.
- `inputs` is an object representing the data your app expects to receive from the user upon step from app execution.
- `outputs` is an array of objects containing data that your app will provide upon the step's completion. Outputs can then be used in subsequent steps of the workflow.
- `step_name` overrides the default Step name
- `step_image_url` overrides the default Step image

Expand Down Expand Up @@ -57,4 +57,4 @@ const ws = new WorkflowStep('add_task', {
},
execute: async ({ step, complete, fail }) => {},
});
```
```
14 changes: 7 additions & 7 deletions docs/content/steps/steps.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
---
title: Overview of Workflow Steps from Apps
title: Overview of steps from apps
lang: en
slug: /concepts/steps
---

:::danger

Workflow Steps from Apps are a deprecated feature.
Steps from Apps are a deprecated feature.

Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions).
Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt).

Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information.

:::

---

Workflow Steps from Apps allow your app to create and process custom workflow steps that users can add using [Workflow Builder](https://api.slack.com/workflows).
Steps from apps allow your app to create and process steps that users can add using [Workflow Builder](https://api.slack.com/workflows).

A workflow step is made up of three distinct user events:
A step from app is made up of three distinct user events:
WilliamBergamin marked this conversation as resolved.
Show resolved Hide resolved

- Adding or editing the step in a Workflow
- Saving or updating the step's configuration
- The end user's execution of the step

All three events must be handled for a workflow step to function.
All three events must be handled for a step from app to function.
WilliamBergamin marked this conversation as resolved.
Show resolved Hide resolved

Read more about Workflow Steps from Apps in the [API documentation](https://api.slack.com/legacy/workflows/steps).
Read more about steps from apps in the [API documentation](https://api.slack.com/legacy/workflows/steps).
10 changes: 5 additions & 5 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const sidebars = {
'basic/options',
'basic/authenticating-oauth',
'basic/socket-mode'
],
],
},
{
type: 'category',
Expand Down Expand Up @@ -78,7 +78,7 @@ const sidebars = {
},
{
type: 'category',
label: 'Workflow steps (Deprecated)',
label: 'Steps from apps (Deprecated)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some soonish enough date 🪓 👀

items: [
'steps/steps',
'steps/creating-steps',
Expand All @@ -87,7 +87,7 @@ const sidebars = {
'steps/executing-steps',
],
},
{type: 'html', value: '<hr>'},
{ type: 'html', value: '<hr>' },
{
type: 'category',
label: 'Tutorials',
Expand All @@ -98,9 +98,9 @@ const sidebars = {
'tutorial/migration-v3'
],
},
{type: 'html', value: '<hr>'},
{ type: 'html', value: '<hr>' },
'reference',
{type: 'html', value: '<hr>'},
{ type: 'html', value: '<hr>' },
{
type: 'link',
label: 'Release notes',
Expand Down
2 changes: 1 addition & 1 deletion src/WorkflowStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function createStepFail(args: AllWorkflowStepMiddlewareArgs<WorkflowStepExecuteM
}

/**
* `prepareStepArgs()` takes in a workflow step's args and:
* `prepareStepArgs()` takes in a step's args and:
* 1. removes the next() passed in from App-level middleware processing
* - events will *not* continue down global middleware chain to subsequent listeners
* 2. augments args with step lifecycle-specific properties/utilities
Expand Down
4 changes: 2 additions & 2 deletions src/types/actions/workflow-step-edit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* A Slack workflow step action wrapped in the standard metadata.
* A Slack step from app action wrapped in the standard metadata.
*
* This describes the entire JSON-encoded body of a request from Slack workflow step actions.
* This describes the entire JSON-encoded body of a request from Slack step from app actions.
*/
export interface WorkflowStepEdit {
type: 'workflow_step_edit';
Expand Down
4 changes: 2 additions & 2 deletions src/types/view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface ViewClosedAction {
}

/**
* A Slack view_submission Workflow Step event
* A Slack view_submission step from app event
*
* This describes the additional JSON-encoded body details for a step's view_submission event
*/
Expand All @@ -112,7 +112,7 @@ export interface ViewWorkflowStepSubmitAction extends ViewSubmitAction {
}

/**
* A Slack view_closed Workflow Step event
* A Slack view_closed step from app event
*
* This describes the additional JSON-encoded body details for a step's view_closed event
*/
Expand Down