Skip to Content

Send a Slack notification from a Studio operation in Jitterbit Studio

Introduction

This integration design pattern sends a formatted message to a Slack channel from a Studio operation. The operation uses the HTTP v2 connector to POST a JSON payload to a Slack incoming webhook URL. This pattern is commonly used to notify a team when a significant event occurs, such as a new order being received, a record being created, or an operation completing with errors.

This guide assumes familiarity with configuring HTTP v2 connections and activities. For a general introduction, see Call a REST API using the HTTP v2 connector.

Design pattern

A Slack incoming webhook is a unique URL generated by Slack that accepts an HTTP POST request containing a JSON message. No additional authentication is required beyond the webhook URL itself.

The Studio operation follows the transformation pattern:

flowchart LR A[Source activity] --> B[Transformation] --> C[HTTP v2 POST activity]

The source activity provides the data used to build the message (for example, a database query result, a Salesforce record, or a script output). The transformation constructs the Slack message payload. The HTTP v2 POST activity sends the payload to the Slack incoming webhook URL.

Webhook limitations and advanced use cases

Slack incoming webhooks are post-only and send to the single channel the webhook was created for. They cannot target a different channel or user at runtime, update or thread messages, upload files, or read and search messages, and Slack rate-limits them to roughly one message per second. For those advanced use cases, use the native Slack connector instead. It authenticates with a Slack app token and provides activities to post to any channel or user (Send Message), search and retrieve messages (Search and Get), upload files (Files), and look up users and conversations (Users and Conversations).

Part 1: Create a Slack incoming webhook

  1. In your Slack workspace, go to Apps and search for Incoming WebHooks, or create a Slack app at api.slack.com/apps and add the Incoming Webhooks feature.

  2. Activate incoming webhooks and click Add New Webhook to Workspace.

  3. Select the channel to post to and click Allow.

  4. Copy the webhook URL. It has the format https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX.

    Tip

    Store the webhook URL as a project variable with its value hidden. This keeps the URL out of the connection and activity configuration directly and makes it easy to change without editing the project.

Part 2: Configure the HTTP v2 connection

  1. In Studio, open your project and click the Project endpoints and connectors tab in the design component palette.

  2. Click the HTTP v2 connector to open the connection configuration.

  3. Connection Name: Enter a name such as Slack.

  4. Base URL: Enter https://hooks.slack.com. Individual POST activities will append the webhook path.

  5. Authorization: Select No Auth. Authentication for Slack incoming webhooks is handled by the unique webhook URL, not by an authorization header.

  6. Click Test, then click Save Changes.

Part 3: Configure the POST activity

  1. On the design component palette, expand the Slack HTTP v2 endpoint and drag the POST activity type onto the design canvas.

  2. Double-click the activity to open its configuration.

Step 1: Enter a name and specify settings

  1. Name: Enter a name such as Post Slack Message.

  2. Path: Enter the path portion of your webhook URL (everything after hooks.slack.com), for example /services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX.

    If you stored the webhook URL as a project variable, enter the full URL here instead (for example, [slack_webhook_url]). A full URL overrides the Base URL from the connection.

  3. Request Headers: Click the add icon and add the header Content-Type with the value application/json.

  4. Click Next.

Step 2: Provide the request schema

  1. Select Yes, Provide New Schema.

  2. Enter the following JSON schema, which defines the fields of a Slack message payload:

    {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    }
    

    For richer messages with sections, buttons, or formatted blocks, replace this schema with a Slack Block Kit structure. The text field serves as a fallback for notifications and accessibility.

  3. Click Next.

Step 3: Provide the response schema

The Slack incoming webhook returns a plain-text response (ok on success). No custom response schema is required. Click Next, then click Finished.

Part 4: Map the message in a transformation

In the transformation that precedes the POST activity, map the text field of the request schema to a script that constructs the message string.

For example, to send a message about a new order, the transformation script for the text field might be:

<trans>
"New order #" + $order_id + " received from " + $customer_name + " for $" + $order_total
</trans>

Where order_id, customer_name, and order_total are global variables populated by a preceding script or mapped from the source activity.

Tip

To include a newline in the message text, use "\n" in the script string. Slack renders line breaks in channel messages.

Verify the integration

Deploy and run the operation to test the notification. Check the operation logs to confirm the POST activity returned an HTTP 200 status. If the operation logs show a non-200 status, verify the webhook URL path and confirm the Slack app is still installed in the workspace.