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, Telegram chat and Endpoint URL.

  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}}, {{ticket-intake.send.telegram}} 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.

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: restore the memory from Timeline in Memory, 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. Restore it from Timeline in 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 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. Click Open Memory and turn on that memory under Ships with the agent in Memory › Settings, or remove the reference.

References - Docs