Skip to main content
Hand an Automation Tool's result back to whoever called it. Shares a CRD type code with Push Message.

Response

Response is the output processor used by Automation Tools.

Its CRD type is push-message

Response shares the type push-message with a Bot workflow's Push Message. The workflow's type is what separates them: in an automation_tool workflow it accepts only payload and plays the part of handing a result back to the caller, while in a bot workflow it is the Push Message that sends a message to the user, configured with message, template, flush and payload.

So when you see type: push-message in a CRD, check the workflow's type first to know which page applies.

Basic usage​

Response takes data from the workflow, shapes it according to the configured Payload, and returns it as the Automation Tool's final result.

Configuration​

Name​

The name shown on the canvas, used to identify this processor within the workflow.

Description​

Explains what this processor is for, making the workflow easier to read.

Properties​

Payload (required)​

The result to return, as an Expression. Use JavaScript to process and shape the workflow's variables.

In the Workflow CRD​

The type is push-message, and in an Automation Tool workflow it accepts only payload:

- name: proc-response
type: push-message
labels:
display_name: Response
configs:
- name: payload
expression: |-
(() => {
return {
result: "Navigation request sent to the user's UI."
};
})()

As a tool's endpoint, relationships is usually written as an empty array.

Relationships​

Success​

Once the result has been produced, the workflow continues from this connection point.

Failure​

If producing the result fails, the workflow continues from this connection point and a prevError variable holds the error.

Examples​

Returning data​


Example Response payload:

(() => {
return {
result: httpResponse.json,
status: 'success',
};
})()

The returned result is also an instruction to the agent​

The payload goes straight to the agent that called the tool, so it is not only data but the basis on which the agent interprets what happened. In practice, result states exactly how far the action got, so the agent does not overclaim:

(() => {
return {
result: "Navigation request sent to the user's UI. Whether it takes effect is decided by the client, which may reject an invalid path or filter. Do NOT tell the user that the page has changed; report only that the navigation request was sent. This is a UI-only action, not a user response."
};
})()

This tool only emits a UI navigation event. Whether it takes effect is the frontend's decision, so the payload explicitly asks the agent to report that the request was sent, not that the page has changed.

Notes​

  • This node exists only in an automation_tool workflow. The same CRD type code, push-message, is Push Message in a bot workflow, with an entirely different set of settings.
  • The Payload expression has to return a valid JavaScript object or value.