Messaging channels

Messaging channels are reusable, instance-level connections through which Dataiku sends messages. Administrators create and manage them in Administration > Settings > Notifications & Integrations > Messaging channels.

They can be used by scenario reporters, custom Python scenarios through get_message_sender(...), and some alerting and notification features.

Supported channel types

Dataiku supports the following types of messaging channels:

  • Mail: Mail (SMTP), Mail (via Amazon SES), or Mail (via Microsoft 365 with OAuth).

  • Chat and messaging: Slack, Microsoft Teams, or Google Chat.

  • SMS: Twilio.

  • Command execution: Execute shell command.

Configure a messaging channel

Only administrators can create, modify, and delete messaging channels. Each channel has a unique name, connection settings specific to its type, and usage permissions.

After an administrator creates a channel, scenario authors and other users can select it by name wherever messaging channels are supported.

Administrators can restrict which users and groups can use each channel. For details, see Messaging channel permissions. By default, a channel is usable by all users.

Mail channels

Mail (SMTP)

To configure an SMTP channel, you need access to an SMTP server. You will need to get the host and port, and, if necessary for authentication, the credentials (login and password), from your mail administrator or service provider.

The connection security setting must match what the SMTP server expects. The UI gives the following options:

  • Use SSL: This is for implicit TLS: the TLS connection starts before SMTP communication begins. The default port is 465.

  • Use TLS: This is for STARTTLS: the connection starts with SMTP and then upgrades to TLS. The default port is 25.

  • If neither option is selected, the connection is not encrypted. Use this only if the SMTP server and network configuration permit it. The default port is 25.

The server configuration takes precedence over the default ports. Specify the port supplied by the mail administrator or service provider.

You can also configure a fixed sender address or use the current user’s email address for messages triggered by user actions. The Authorized recipients domains setting restricts the domains to which the channel can send mail.

Mail (via Amazon SES)

To configure an Amazon SES channel, provide an AWS access key and secret key with permission to send emails through Amazon SES. You can also specify an AWS region, such as eu-west-1, or a custom endpoint.

As with an SMTP channel, you can configure a fixed sender address or use the current user’s email address for messages triggered by user actions. The Authorized recipients domains setting restricts the domains to which the channel can send mail.

Mail (via Microsoft 365 with OAuth)

Dataiku can send emails through Microsoft 365 using OAuth2. To configure this channel, first create an application in Microsoft Entra ID with the required permissions:

  1. Sign in to the Azure portal and navigate to the Microsoft Entra ID resource. Select App registrations, provide a name for the application, and register it without a redirect URI. Record the Application (client) ID and Directory (tenant) ID.

  2. Select Certificates & secrets and create a client secret. Record its Value, which is no longer visible after you leave the page.

  3. Select API permissions and add the Mail.Send permission under Microsoft Graph > Application permissions. The permission must be of type Application, not Delegated. Ask an Azure administrator to Grant admin consent. By default, this allows the application to send emails as any user in the tenant who has a valid Microsoft 365 license. The Azure administrator can restrict application access to specific mailboxes.

Then, add a channel in Administration > Settings > Notifications & Integrations:

  1. Add a Mail (via Microsoft 365 with OAuth) channel.

  2. Fill in Application (client) ID, Directory (tenant) ID, and Client secret with the values recorded when configuring the application.

  3. Fill in Sender account with the User Principal Name of a user in the tenant who has a valid Microsoft 365 license.

Slack

Dataiku supports two modes for sending messages to a Slack channel:

To use a Slack incoming webhook, set Mode to Use incoming webhook and provide the Webhook URL. This is a URL in Slack to which Dataiku sends requests to post messages in a Slack channel.

To post messages as a Slack app’s bot user, set Mode to Use API and provide the bot token in Authorization token. The app needs the chat:write scope and access to the target Slack channel. See Slack’s app setup documentation for details on obtaining a bot token.

Microsoft Teams

To send messages to Microsoft Teams:

  • In Microsoft Teams, create a workflow using the Send webhook alerts to a channel template. Configure the target team and channel, then save the workflow.

  • Copy the webhook URL generated by the workflow.

  • In Dataiku, set Webhook type to Workflow and paste the URL into Webhook URL.

For details, see Microsoft’s guide to sending messages in Teams using incoming webhooks.

Once configured, the integration supports simple text messages and more complex Adaptive Cards created as JSON.

Scenario reporters can use Adaptive Cards to display a title and a color that depend on the scenario outcome. For an example, see Slack, Microsoft Teams, Google Chat, Webhook and Twilio reporters.

Google Chat

To send messages to Google Chat:

  • In Google Chat, create a webhook in the channel and copy its URL.

  • In Dataiku, paste the webhook URL into Webhook URL. To encrypt the credentials separately, remove the key and token parameters from the URL query string. Enter the value of the key parameter in Webhook Key and that of the token parameter in Webhook Token.

You can format messages sent to Google Chat, but cards are not supported.

Execute shell command

An Execute shell command channel runs a command on the Dataiku host. It supports two types:

  • Command: Runs sh -c <command>.

  • Script file: Runs the script entered in the channel configuration. If Command is empty, Dataiku runs sh script_file. Otherwise, it runs sh -c <command> script_file.

When using the channel in a scenario reporter, you can pass either all scenario report data or selected values to the command as environment variables. Passing all data might exceed operating-system limits on the size of environment variables.

Messaging channel users

Messaging channels can be used by:

  • Scenario reporters and Send message scenario steps. Custom scenarios pass the channel name to Scenario.get_message_sender(). For examples, see Custom scenarios.

  • The Send Message agent tool.

  • Dataiku notification emails, such as welcome emails, activity digests, and discussion notifications. To configure notification emails, create a mail channel and select it under Administration > Settings > Notifications & Integrations > Notification emails. This selection is separate from using mail channels in scenarios and other user actions.

  • The public API, which can list messaging channels and, with administrator privileges, create, configure, or delete them. For mail channels, POST /public/api/messaging-channels/{channel-id}/actions/send?projectKey={project-key} sends an email. The corresponding Python API method is DSSMailMessagingChannel.send().