Mapping in the expressions editor
This page shows a few common examples you can use in the expressions editor to reference data.
Access the linked item in a previous node’s output
Section titled “Access the linked item in a previous node’s output”When you use this, Agentic WorkFlow works back up the item linking chain, to find the parent item in the given node.
// Returns the linked item{{$("<node-name>").item}}As a longer example, consider a scenario where a node earlier in the workflow has the following output data:
[ { "id": "23423532", "name": "Jay Gatsby", }, { "id": "23423533", "name": "José Arcadio Buendía", }, { "id": "23423534", "name": "Max Sendak", }, { "id": "23423535", "name": "Zaphod Beeblebrox", }, { "id": "23423536", "name": "Edmund Pevensie", }]To extract the name, use the following expression:
{{$("<node-name>").item.json.name}}Access the linked item in the current node’s input
Section titled “Access the linked item in the current node’s input”In this case, the item linking is within the node: find the input item that the node links to an output item.
// Returns the linked item{{$input.item}}As a longer example, consider a scenario where the current node has the following input data:
[ { "id": "23423532", "name": "Jay Gatsby", }, { "id": "23423533", "name": "José Arcadio Buendía", }, { "id": "23423534", "name": "Max Sendak", }, { "id": "23423535", "name": "Zaphod Beeblebrox", }, { "id": "23423536", "name": "Edmund Pevensie", }]To extract the name, you can use drag-and-drop mapping in the UI, or write the following expression:
{{$input.item.json.name}}