Skip to main content

Slack Message from iPaaS.com

Updated over 2 weeks ago

Overview

This integration enables the transfer of error messages from an iPaaS.com transaction to a specified Slack channel or user. The process is primarily designed for automated error alerting and can be triggered via outbound webhooks. It ensures that critical system errors are delivered as formatted messages in Slack for immediate review.

Mapping Collection Status

  • Status: Enabled

  • Trigger Events: This integration runs when a message is created or updated in the source system.

Id Format

Slack uses a unique alphanumeric identifier for each user, for example, U08D7VC7HBR. The integration resolves the target user's ID before sending the message.

Duplicate or Conflicting Collections

  • User Resolution: If a Slack user has both a Name and a RealName, the system attempts to resolve the Name first.

  • Message Uniqueness: Messages with an identical UniqueId are considered duplicates and will not be re-sent.

Prerequisites

To use this integration, you must have an active iPaaS.com environment and a Slack workspace with the necessary API permissions to post messages.

Integration Flow

  1. Error Event Trigger: An error event is logged in iPaaS.com. The integration only processes errors that have an ExternalSystemId and have reached a retry count of 3.

  2. User ID Resolution: The integration looks up the target Slack User ID by matching the provided profileName against Slack's Name and RealName fields.

  3. Message Preparation: The error message content is built. If the content exceeds 3,500 characters, it is truncated, and a follow-up notice is appended.

  4. Message Delivery: The prepared message is sent to the Slack Web API.

  5. Slack Acknowledgment: Slack confirms successful delivery or returns an error, which is logged in iPaaS.com.

Mappings

Slack Message (Parent)

Mapping Filter

if(DetailFields != null ZZ_BAR_ZZZZ_BAR_ZZ DetailFields.ContainsKey("ExternalSystemId")) { if(!DetailFields.ContainsKey("RetryCount")) return false; var retryCountStr = DetailFields["RetryCount"]; if(int.TryParse(retryCountStr, out int retryCount)) return (retryCount == 3); return false; } else return false;

Description: This filter ensures that a message is only sent if it originates from an error (has an ExternalSystemId) and has failed three previous delivery attempts (retryCount == 3).

Field Mappings

Mapping Type

Source (iPaaS.com)

Destination (Slack)

Description

Dynamic Formula

await UserIdFromName("your_slack_user_name_here")

Channel

Required. Retrieves the unique Slack User ID for the specified profile name.

Dynamic Formula

if(Details.Length > 3500) Details = Details.Substring(0, 3500); StandardMessage(Text, Details, DetailFields, Links)

Text

Required. Constructs the message body and truncates it at 3,500 characters if necessary.

Static

... (the remainder of the error message has been truncated per Slack's character limits)

FollowUpMessage

A static message is appended to the primary text when truncation occurs.

Error Handling

Error: Invalid profileName

  • Description: The specified user could not be found in Slack by their Name or RealName.

  • Resolution: Verify the user exists in the Slack workspace and that the name is spelled correctly in the source system.

Error: Message Too Long

  • Description: The original message content exceeds Slack's character limits.

  • Resolution: This is handled automatically by the integration, which truncates the message and appends a notice.

Error: Missing ExternalSystemId

  • Description: The trigger event is not an error message.

  • Resolution: The mapping filter automatically suppresses the message. No action is needed.

Error: Retry Count Not Met

  • Description: The error has not yet reached the required retry count of 3.

  • Resolution: The mapping filter automatically suppresses the message. No action is needed.

Validation Rules

  • Each Message ID must be unique. Duplicate Message IDs are not permitted, as every record must represent a distinct message in Slack. If a Message ID already exists, the new message will be skipped to avoid duplication.

  • A valid Message Email is required. The email must be provided in the correct format (e.g., user@example.com). If the email is missing or invalid, the message transfer to Slack will not proceed.

Testing & Validation

Test Scenarios

  • A valid short message is sent (< 3,500 chars). The message is delivered successfully to the specified Slack user.

  • A long message is sent (> 3,500 chars). The message is truncated, a follow-up notice is added, and the message is delivered successfully.

  • A message is sent to an invalid profileName. The message is not delivered, and an error is logged in iPaaS.com.

  • An error message with a retryCount less than 3 is triggered. The message is suppressed by the mapping filter and is not sent.

Validation Checklist

  • Ensure the profileName resolves to a valid Slack user.

  • Confirm that only messages with an ExternalSystemId are processed.

  • Verify that the retryCount == 3 logic is enforced.

  • Check that long messages are correctly truncated and include the follow-up notice.

Did this answer your question?