Skip to content

version 1.41.0

Compare
Choose a tag to compare
@seratch seratch released this 20 Aug 07:58
· 49 commits to main since this release

Announcements

Support for custom steps

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"
            }
        },
        "output_parameters": {
            "channel_id": {
                "type": "slack#/types/channel_id",
                "title": "DM ID",
                "description": "The DM ID",
                "is_required": true,
                "name": "channel_id"
            },
            "ts": {
                "type": "string",
                "title": "Message timestamp",
                "description": "Sent message timestamp",
                "is_required": true,
                "name": "ts"
            }
        }
    }
}

Please refer to https://api.slack.com/automation/functions/custom-bolt for more details!

Changes

  • [bolt] #1241 Add custom function support - Thanks @seratch
  • [bolt][slack-app-backend] #1351 #1343 block_suggestion response does not support description in an option - Thanks @ESteanes @seratch
  • [slack-api-client] #1346 Fix a bug where filename & title getting improperly defaulted in filesUploadV2 - Thanks @Cheos137
  • [slack-api-client] Add missing properties in web API responses - Thanks @seratch