> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# On New Message

> A trigger that activates workflows when new messages are received in Slack

A trigger that activates workflows when new messages are received in Slack

|                     |                        |
| ------------------- | ---------------------- |
| **App**             | Slack                  |
| **Operation ID**    | `slack_on_new_message` |
| **Type**            | Trigger                |
| **Connection**      | `slack` (required)     |
| **Credits per run** | 1                      |

## Inputs

| Field      | Type                       | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ---------- | -------------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `channels` | string or SelectableOption | Yes      | -       | Configure which channels to monitor for new messages. Available options: 'all' - Monitor all channels where the bot is added 'specific' - Monitor only a specific channel  Important: The bot only listens to messages where @Markifact is mentioned. Make sure the bot is added to the channels you want to monitor.                                                                                                                                                                                                                                                                                                                                |
| `channel`  | SelectItem                 | No       | -       | The specific Slack channel to monitor for new messages.  This field is required when channels is set to 'specific'.  Select any public channel where the bot has been added, or private channels where the bot is a member. The channel value should be the channel ID, not the channel name.  Example: Channel ID like 'C1234567890' for #general                                                                                                                                                                                                                                                                                                   |
| `message`  | object                     | No       | -       | The message event data that triggered this workflow. This field is automatically populated when a new message is received and contains information like: - message: The actual message text - channel: Channel information - thread\_id: Thread ID if it's a threaded message   - conversation\_id: Unique conversation identifier - user\_id: ID of the user who sent the message - username: Username of the sender - user\_real\_name: Real name of the sender - today\_date: Current date when the message was received  This data can be referenced in downstream nodes using \{\{nodeId\_\_data.message}}, \{\{nodeId\_\_data.user\_id}}, etc. |

### SelectItem

| Field   | Type   | Required | Default | Description                                                                                          |
| ------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `value` | string | Yes      | -       | The value of the selectable item.                                                                    |
| `label` | string | Yes      | -       | The label of the selectable item, used for display purposes. If not provided, defaults to the value. |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `Dict`

Returns the incoming message details.

**Fields**: `message`, `channel`, `thread_id`, `conversation_id`, `user_id`, `username`, `user_real_name`, `today_date`
