References

Put a memory, a document, or a value from an earlier neuron into a neuron's instructions, inputs or SEND fields with a reference.

A reference puts something into a text field by name: a memory or document from the workflow's Memory, such as a price list in the DO instructions, a value from an earlier neuron, such as its output or one of its inputs, or one of the workflow's variables, such as a tone. On each run, the reference is replaced with what it points at right then. Use a memory reference when a neuron must always use one exact memory or document, rather than whatever Memory finds relevant, and a neuron reference to reuse what an earlier neuron received or produced.

Insert a reference

References work in GET text inputs and the values you add to a queue, the DO Instructions, and the SEND fields Email to and Endpoint URL, and the email's Subject and Body. A Telegram send goes to a chat you connected, so its field takes no reference.

  1. Click in the text field.
  2. Type two opening curly braces ({{), or click Insert a reference.
  3. Pick from the list. It has a group for each other neuron in the workflow, with the neurons that run before this one first, a VARIABLES group, and a MEMORY group. Type to search the list (Search neurons and Memory).

A value that can't be used in this field stays in the list, greyed out. Hover over it to see why.

The reference shows in the text as a pill with what it points at: a variable as its name and value, such as Tone · Friendly, anything else as its name. A reference you type yourself turns into a pill as soon as you type the closing braces (}}). The pill is blue when it works, and red when it doesn't (crossed out too when what it names doesn't exist). Hover over a pill to see its reference, or why it can't be used. A pill counts as one piece of text: Backspace removes it whole, and undo brings it back. The pills also show on the neuron's card on the canvas.

To change a reference, click its pill: it turns into text, with the cursor at the end of the reference, so you can edit it. Move the cursor out of it and it becomes a pill again.

The Open editor window works the same way, in both Preview and Raw: type {{ to open the list, and references show as pills.

What a reference looks like

A reference to a memory looks like {{memory.customers-plan}}: the word memory, a dot, and the memory's ID, which is made from its name. Open the memory in the Memory section to see its reference under SAVED IN MEMORY; the copy button beside it (Copy ID) copies it, so you can paste it into any field that takes references.

Reference IDs of neurons and inputs

Every neuron and every GET input has an ID, made from its name the first time, for example ticket-intake for a neuron called "Ticket intake" and customer-email for an input called "Customer email". The ID shows as a chip that starts with ID:

  • In MAKE, the neuron's chip, for example ID ticket-intake.make.output.
  • In GET, each input's chip, for example ID ticket-intake.get.customer-email.

Click a chip (Copy ID) to copy the reference, such as {{ticket-intake.get.customer-email}}, and paste it into any field that takes references.

Renaming a neuron or an input doesn't change its ID, so references to it keep working.

Change an ID

  1. For a neuron, open Neuron options (the three dots next to the neuron's name) and choose Change ID…, or click the pencil (Change ID) next to its chip in MAKE. For an input, click the pencil next to the input's chip in GET.
  2. Type the new ID: lowercase letters, numbers and single dashes. Each neuron's ID must be unique in the workflow, and each input's ID unique in its neuron.
  3. Click Change ID.

The dialog lists the neurons that use the ID. Changing it updates their references in the same step.

Refer to another neuron

A neuron reference looks like {{ticket-intake.make.output}}: the neuron's ID, the part (get, do, make or send), and the value. You can refer to:

  • An input: {{ticket-intake.get.customer-email}}, the value that input had on this run.
  • The instructions: {{ticket-intake.do.instructions}}.
  • The result: {{ticket-intake.make.output}}.
  • The error message: {{ticket-intake.make.error}}, only in a neuron that an On error link starts when that one fails. See On error links.
  • A SEND destination: {{ticket-intake.send.email}} or {{ticket-intake.send.api}}, when that neuron sends there.

The neuron must run before this one through its connections, directly or through other neurons. A neuron's result can only be used by a neuron that runs after it finishes, and a decision's result can't be used at all, because a decision only picks which branch runs. A file result, such as an image or audio, can only go in the DO Instructions, not in a text field.

In the email's Subject and Body only, a neuron can also use its own result, {{ticket-intake.make.output}} in the neuron "Ticket intake" itself, so the email can say what this run made. The Insert a reference list offers it first, as This neuron › Output (this run). Anywhere else a neuron can't refer to its own result. See The email's subject and body.

A value can contain references

The text a reference points at can contain references of its own, and they are filled in too. This works for text you wrote: a variable's value, another neuron's instructions, a text input you typed in, and another neuron's SEND fields. For example, a reference to the input {{ticket-intake.get.rules}} can hold the text Reply in a {{vars.tone}} tone, and the neuron reads it with the tone filled in.

References are filled in up to three levels deep: a field points at a value (1) that points at a value (2) that points at a value (3). A fourth level stops the neuron.

Text that can come from somewhere else is never searched for references, so a {{…}} in it stays as it is. That covers text from Memory, a neuron's result and error message, a dashboard value, an input filled by an incoming connection, a webhook or a trigger (such as a CV), and the content of a file or web page.

On the canvas, a reference that can't be filled in because of what is inside its value turns red, and hovering over it says why. The neuron's issue list shows it too, under the reference you typed in the field, for example "Instructions → {{vars.tone}}: No variable called vars.mood (reached through {{vars.tone}})". Fix the value the message names, or remove the reference you typed.

References and Don't use

A memory set to Don't use stays in the reference list but can't be picked, and an existing reference to it stops working until you turn the memory back on with Use again. References still work when DO's Use memory in this run is turned off: that switch only controls what Memory adds by itself.

Common problems

This neuron won't run until it's fixed

A neuron with a broken reference doesn't run. The tab with the reference shows the issue at the top, for example "Instructions → … : Deleted from Memory". The usual reasons:

  • Deleted from Memory: undo the delete from Versions (within 7 days), or remove the reference.
  • No memory called this name: the reference points at a memory that doesn't exist. Pick the right one with Insert a reference.
  • Expired from Memory: the memory's Keep it time ran out, or an Auto memory went 7 days without use. Remove the reference, or point it at another memory.
  • Set to Don't use in Memory: turn it back on with Use again.
  • Memory is text and can't fill this field: a field that needs a file or table can't take a text memory.
  • No variable called this name: the variable was deleted or its ID changed. Pick the right one with Insert a reference. See Variables.
  • No neuron with the ID …: the neuron was deleted or its ID changed. Pick the right value with Insert a reference.
  • Not upstream: the neuron doesn't run before this one. Connect it to this neuron first, or pick a neuron that does.
  • Not ready: the connection starts this neuron When it starts, before the other neuron has a result. Open the connection and choose After it finishes. See Connections.
  • Reference IDs are lowercase letters, numbers and dashes: an ID was typed with capitals or underscores. Use the lowercase form shown in the message.

A loop or a chain that is too long

A neuron stops, with a message naming the reference, in two more cases:

  • Circular: a value ends up using itself, for example variable A contains {{vars.b}} and variable B contains {{vars.a}}. The message lists the loop. Remove one of the references in it.
  • References can be nested 3 levels deep: a chain of values is longer than three levels. Shorten the chain by putting the text in one place, instead of one value pointing at another that points at another.

An email isn't sent because of a reference

A reference in an email's Body that can't be filled in stops that email, instead of sending it with the reference in it. The SEND shows the reason, for example Email body: {{shortlist.make.output}}: …. Fix or remove the reference. A reference placed inside a tag or a link in the Body, such as <a href="…{{ref}}">, stops the email too: put references in the text. So does a value too large for an email. A reference in the Subject that can't be filled in only changes the subject to the default one. Preview shows these before you run.

A neuron hasn't produced a value yet

On a run, a neuron reference whose neuron hasn't run yet stops the neuron with "… hasn't produced a value yet. Run it first." Run the earlier neuron first, or run the whole flow.

A reference blocks publishing

When you publish, a reference to a memory that doesn't ship with the agent blocks publishing, because Users wouldn't have it. The Publish studio names the neuron and the reference, for example "Neuron “Ticket intake” uses {{memory.customers-plan}}, which doesn't ship with the agent." Click Open Memory next to the message and turn on Ships with the agent for that memory in Memory › Settings, or remove the reference, then publish again. See Publishing your agent.

References - Docs