Sends final messages back to users through the ChatBot interface and marks the workflow as completed, ending workflow execution.
The sendResponse function allows your workflow to send messages back to the user through the ChatBot interface and always marks the workflow as completed, ending the workflow execution. This is the final communication step in any workflow.
Send final messages to users and complete the workflow. This function serves as the definitive endpoint for workflow execution, ensuring users receive final results while properly terminating the workflow process.
Critical Behavior: The sendResponse function ALWAYS ends workflow execution regardless of the response type. No steps after sendResponse will ever execute.
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Response delivery method: "fixed" or "ai" | |
| message | string | Final content to send to the user |
Sends the message directly to the user exactly as written, without AI processing, then completes the workflow
Processes the message through AI to create a more natural, conversational final response, then completes the workflow
Notify users when automated processes complete:
Remember: Once sendResponse executes, your workflow is complete and no further steps will run. Plan your workflow structure accordingly to ensure all necessary processing occurs before the final response.
Basic workflow completion with a status message:
- id: schedule_complete
function: sendResponse
input:
type: fixed
message: "Your database monitoring alert has been scheduled and is now active."Detailed completion message with dynamic content and formatting:
Dynamic completion messages based on workflow results:
The sendResponse function fully supports variable interpolation for dynamic final message content:
Common pattern of sending detailed information via email, then providing a summary response:
Adapting the final message based on workflow outcomes:
Content Size Management: The function includes automatic content size management with a 40,000 character maximum. Oversized content is automatically truncated with a warning message.
Make it clear to users that the process has finished and what was accomplished.
Ensure the final message provides value and actionable information to the user.
Maintain appropriate tone and formatting for your audience and use case.
Structure your workflows properly to ensure clean completion and resource management.
These functions complement sendResponse for building complete user communication workflows: