Bolt for Java now supoports the way to build custom steps in Workflow Builder. Here is a quick example demonstrating how it works:
app.function("sample_function", (req, ctx) -> {
app.executorService().submit(() -> {
try {
var userId = req.getEvent().getInputs().get("user_id").asString();
var response = ctx.client().chatPostMessage(r -> r
.channel(userId) // sending a DM
.text("Hi! Thank you for submitting the request! We'll let you know once the processing completes.")
);
var outputs = new HashMap<String, Object>();
outputs.put("channel_id", response.getChannel());
outputs.put("ts", response.getTs());
ctx.complete(outputs);
} catch (Exception e) {
ctx.logger.error(e.getMessage(), e);
try {
ctx.fail("Failed to handle 'sample_function' custom step execution (error: " + e.getMessage() + ")");
} catch (Exception ex) {
ctx.logger.error(e.getMessage(), e);
}
}
});
return ctx.ack();
});
The App Manifest for the custom step would be something like this:
"functions": {
"sample_function": {
"title": "Send a request",
"description": "Send some request to the backend",
"input_parameters": {
"user_id": {
"type": "slack#/types/user_id",
"title": "User",
"description": "Who to send it",
"is_required": true,
"hint": "Select a user in the workspace",
"name": "user_id"
}
</tr></table>
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps com.slack.api:bolt-socket-mode from 1.40.3 to 1.41.0.
Release notes
Sourced from com.slack.api:bolt-socket-mode's releases.
... (truncated)
Commits
e3702f3
version 1.41.0bd8e9c4
Upgrade http4k version to the latest52d1c76
Add custom function support (#1241)efa3f24
Fix #1343 block_suggestion response does not support description in an option...11a6def
Run all the integration tests - 2024-08-19 PT0bee2ae
Upgrade http4k and micronaut (#1350)d4622ca
Fix #1345 filename & title getting improperly defaulted in filesUploadV2 (#1346)7859986
Run all the integration tests - 2024-08-16 PT71ed00d
docs: google analytics tag (#1344)fdbe39f
Docs: adds docusaurus site (#1342)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show