Workflows

How to use data from one workflow step in the next

How to use data from one workflow step in the next

In a TeleportHQ workflow, each step can use data from the steps before it. This data is called the Context. Click a step, then drag a value from the Context panel at the top right of the workflow canvas onto a field, or click the Select from context button next to a field and pick the value. For example, you can put the email address someone typed into your form into the To field of a Send Email step.

Before you start

  • You need a workflow with a trigger and at least one step after it. See How to create a workflow.
  • A step can only use data from the trigger and the steps above it. Data from later steps isn't available.

Steps

This example sends a confirmation email to the person who filled in a bakery's Order cake form.

1. Find the data

  1. Open the workflow in the Workflows panel.
  2. On the canvas, click the step that needs the data, for example Send Email (SendGrid). Keep the Node Properties tab open in the right panel: the Context panel only shows on that tab.
  3. At the top right of the canvas, the Context panel shows the number of items available to this step. Click its header to fold or unfold it.
  4. Find the trigger's item, for example the Form is Submitted data, with its fields such as email and name. With more than three items, use Search context... to find one.

Click the info icon in the panel header (tooltip How to use context) for a short guide, Using Workflow Context.

The TeleportHQ workflow Context panel, listing the data the selected step can use from earlier steps

2. Put the data into a field

Use either method:

  • Drag and drop: drag the email item from the Context panel onto the To field in the right panel.
  • Pick from a list: next to the To field, click the connect button (tooltip Select from context). In Select Context Value, click email.

The field now shows a badge with the value's name instead of text.

The TeleportHQ Select Context Value list, opened from the Select from context button of a step's field

3. Mix data with your own text

Some fields let you combine typed text with context values:

  • In an email's Raw content body, click Insert Variable in the editor's toolbar to add a value at the cursor, for example Hi followed by the name value.
  • In an SMS Message, click Add value to concatenate to add another part, then type text in one part and pick a context value in the next. The parts are joined in order.
  • In the conditions of Select Data and Count Data, Insert Variable adds a value from a previous step.

Check that it worked

  • Click the badge in the field (tooltip Click to locate in context panel). The matching item is highlighted in the Context panel.
  • Test the step. The test window lists the values it needs under Inputs from previous nodes, so you can type sample values. See How to test a workflow step.

Troubleshooting

The Context panel says "This is the first step. Context from previous steps will appear here as you add more nodes." You selected the trigger or the first step. Select a step further down.

The Context panel says "No context available from previous steps." The steps above don't produce data you can use. Check that the step is connected below the step whose data you need.

The Context panel isn't on the canvas It only shows while a step is selected and the Node Properties tab is open. Click a step, then click Node Properties.

The Select from context button is greyed out ("No context available") There is no earlier data for this step. Move the step lower in the workflow or add the step that produces the data first.

I can't drop a whole object onto a field Unfold the item and drag one of its properties, for example email rather than the whole form data.

"Some pasted steps read data from steps that are not in this workflow: … Update their settings." You pasted steps whose fields used data from steps you didn't copy. Open each named step and pick its values again.

A step shows "Missing" or a Missing State References warning A state the step used was deleted or renamed. See Why does my workflow show missing configuration or security warnings?.

Good to know

  • Context values have types: Text (single values), Object (contains properties) and Array (lists of items).
  • To remove a value from a field, click the × on its badge (tooltip Remove context binding).
  • To use a page state inside a workflow, add a Get Local State or Get Global State step first, then use its result.
  • Custom nodes receive all context from the workflow that runs them. See How to reuse a group of steps (custom nodes).
Share

Related Articles

What are workflows?

A workflow in TeleportHQ is a visual recipe that makes your web app do something, one trigger (like a button click or a form submission) followed by steps (like saving to a database, sending an email or opening a page), built without writing code; adding one makes a website a web app.

How to create a workflow

In TeleportHQ, open the Workflows panel in the editor's left sidebar, click Add Workflow, replace the starting trigger with the one you need, then add and set up each step on the workflow canvas; copy, paste and tidy steps from the canvas.

How to send emails and text messages from a workflow

In a TeleportHQ workflow, add a Send Email step (SendGrid, Mailgun, Mailersend, Postmark or Resend) or a Send SMS step (Twilio, TextMagic, Infobip or SMSAPI), enter your provider's API key, then fill in the sender, recipient and message; the provider you set up becomes the project's provider.

How to save, update or delete database records with a workflow

In a TeleportHQ workflow, add a Data step (Create Item, Update Item, Delete Item, Select Data, Count Data or Raw SQL Query), choose the data source and table, then fill in the column values and filters, often from form data.

How to test a workflow step

In TeleportHQ, click a workflow step and click Test in the right panel (or right-click the step and choose Test this node…), fill in sample values for the data it needs, then click Run test to run that one step for real and see its output; the Test runs tab lists every test of the workflow.