Skip to main content

What is a Message Object?

Every node in Robomotion processes a message object that is passed on from a previous node.

Message Object passed

A message object is a simple JSON object that looks something like this;

{
"id": "cahuccj3cf1scmmfcc4uqmjwgt",
"payload": 1668877379280
}

Whenever a msg object is passed to a node, that node manipulates the object, either by adding, deleting or updating fields in the passed object.

Function Node

There is a special node in Robomotion where you can manipulate this object with Javascript.

The Function node is used to write Javascript inside your flows.

A Function node

This function adds my_new_field to the msg object. Function node should always return the msg object;

Debug node

A Debug node shows what is being passed to the next node. Hang one off any output — as in the flow above — and run the flow.

The output appears in the Dev Console, opened with the bug icon in the top right of the canvas. It has three tabs: Events, Debug and Agents. The Debug tab is where the message lands, and after this flow runs it shows the message with my_new_field on it, alongside the id and payload that Inject created.

What it is for

The message is what lets a node use a value it did not produce itself.

In the flow above, Add A Field does not just set my_new_field — it also sets msg.url. The Use The Field node after it makes an HTTP request, and instead of having the address typed into it, its URL property reads msg.url.

That is the whole idea, and every node property works this way. A property can hold either:

ScopeMeansUse when
CustomA literal you type into the nodeThe value never changes
MessageRead msg.<field> at run timeThe value is decided earlier in the flow

Look for the small scope selector beside a property — that is what you are choosing between.

Why bother

Because it makes a value computed. A file path with today's date in it cannot be typed into a node, but it can be built in a Function node and read from the message:

var date = new Date().toISOString().split("T")[0];

// C:\\Reports\\2026-08-09.xlsx
msg.path = "C:\\Reports\\" + date + ".xlsx";

Point an Open Excel node's File Path at msg.path and it opens the right file every day without anyone editing the flow.

The same move covers most of what automation needs: a URL that depends on which customer you are processing, a folder that depends on the month, a recipient that depends on who approved the request. One node works it out, the next reads it off the message.

One place to change it

Even for values that never change, putting them in a Function node at the top of the flow beats typing them into four separate nodes. When the address moves, you edit one line instead of hunting for every node that mentions it.