Channel Messages
Send and reply to messages in Microsoft Teams channels.
How it Works
The Channel Messages component talks directly to Microsoft Teams through the Microsoft Teams API.
When you add it to a workflow, you first need to pick a Microsoft Teams credential that you have set up in Nappai. That credential holds the client ID, client secret, tenant ID, and the required scope so the component can authenticate and call the Teams API on your behalf.
Once authenticated, the component can perform one of four actions:
- Send Message Channel – Post a new message (with optional attachments) to a chosen channel.
- Get Channel Messages – Pull the most recent messages from a channel, up to a specified count.
- Get Message from Channel – Retrieve a single message by its ID.
- Reply Message – Send a reply to an existing message.
The component can also be used as a tool for an LLM. In that mode the Tool Name and Tool Description fields let the agent know what the tool does and how to call it.
Operations
This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:
- Send Message Channel: Post a new message (and optional attachments) to a Microsoft Teams channel.
- Get Channel Messages: Retrieve the latest messages from a channel, up to the number you specify.
- Get Message from Channel: Fetch a single message by its ID.
- Reply Message: Send a reply to an existing message in a channel.
To use the component, first select the operation you need in the “Operation” field.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
-
Attachments: List of attachments to send. Each attachment should be a dict with keys:
attachment_name
,url
(for URL attachments),file_path
(for file uploads),file_id
(for Nappai conversation files).- Visible in: Send Message Channel
-
Operation: Choose which action the component will perform.
- Visible in: Send Message Channel, Get Channel Messages, Get Message from Channel, Reply Message
-
Channel ID: ID of the Teams channel where the action will take place.
- Visible in: Send Message Channel, Get Channel Messages, Get Message from Channel, Reply Message
-
Mapping Mode: Enable mapping mode to process multiple data records in batch.
- Visible in: Send Message Channel, Get Channel Messages, Get Message from Channel, Reply Message
-
Message Count: Number of messages to retrieve (default: 20).
- Visible in: Get Channel Messages
-
Message ID: ID of the message to reply to or retrieve.
- Visible in: Get Message from Channel, Reply Message
-
Message Text: Content of the message to send or reply with.
- Visible in: Send Message Channel, Reply Message
-
Team ID: Team Id that contains the channel.
- Visible in: Send Message Channel, Get Channel Messages, Get Message from Channel, Reply Message
-
Tool Name: The name of the tool that will be used when this component is connected as a tool. This name will be displayed to the agent when it selects tools to use.
- Visible in: Send Message Channel, Get Channel Messages, Get Message from Channel, Reply Message
-
Tool Description: A detailed description of what this tool does. This description will help the agent understand when and how to use this tool effectively.
- Visible in: Send Message Channel, Get Channel Messages, Get Message from Channel, Reply Message
-
Tools arguments metadata: Defines the arguments metadata for the tools.
- Visible in: Send Message Channel, Get Channel Messages, Get Message from Channel, Reply Message
Credential – Before using the component, configure a Microsoft Teams credential in Nappai’s credential section. Then select that credential in the component’s “Credential” field. The credential stores the Client ID, Client Secret, Tenant ID, and Microsoft Teams Scope needed for authentication.
Outputs
- Data: The raw data returned from the Microsoft Teams API (e.g., message details, list of messages).
- Tool: A tool representation that can be passed to an LLM so it can call the component programmatically.
Usage Example
Scenario: A user wants to automatically post a daily report to a Teams channel and then reply to any comments.
- Add the component to the workflow.
- Select the “Send Message Channel” operation.
- Configure the fields:
- Team ID:
12345
- Channel ID:
67890
- Message Text:
"Here is the daily report."
- Attachments: (optional) a list of files or URLs.
- Team ID:
- Enable Mapping Mode if you want to send the report to multiple channels at once.
- Add another instance of the component, set the operation to Reply Message, and connect the output of the first instance to get the message ID for the reply.
- Run the workflow – the component will post the report and then reply to any comments automatically.
Related Components
- Microsoft Teams Connector – A component that lets you create, update, and delete Teams teams and channels.
- Microsoft Teams File Upload – Upload files directly to a Teams channel or chat.
Tips and Best Practices
- Use Mapping Mode when you need to process a list of channels or messages in bulk.
- Keep attachments small; large files can cause timeouts.
- Set a reasonable Message Count (e.g., 10–20) to avoid pulling too much data at once.
- Use the Tool Name and Tool Description fields when integrating with an LLM so the agent can choose the right tool.
- Test each operation separately before chaining them together in a workflow.
Security Considerations
- Store the Microsoft Teams credential securely in Nappai’s credential manager.
- Do not expose the credential details in logs or UI.
- Use the least‑privilege scope required for the operations you need.
- Review the permissions granted to the credential regularly to ensure they match your current needs.