> ## Documentation Index
> Fetch the complete documentation index at: https://university.triggr-app.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to workflows

> Build your first Studio workflow, start it from a form, test it and read its runs.

A workflow is a chain of steps that a trigger starts. Each step acts in a connected tool, waits for someone or decides what happens next.

<Frame caption="Build your first workflow: New starter setup built from the New starter request form, saved, tested with Manual Trigger and its run read (1:27).">
  <video controls preload="none" playsInline className="w-full aspect-video rounded-xl" poster="/images/videos/studio-first-workflow.jpg" src="https://mintcdn.com/triggr/GxrCQFDFNLmEMyJ1/images/videos/studio-first-workflow.mp4?fit=max&auto=format&n=GxrCQFDFNLmEMyJ1&q=85&s=c0ce013606bd6f079519b4ef4d879b8a" data-path="images/videos/studio-first-workflow.mp4" />
</Frame>

<Frame caption="The workflow designer: steps on the left, the canvas in the centre, the selected step's setup on the right.">
  <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/designer.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=4e0f7f25071bf7452e65c2c2e925e7f3" alt="The New starter setup workflow in the designer: Components on the left, Trigger, Generate Custom Reference, Send Email and Finish Workflow joined in a line on the canvas, and the Send Email step panel on the right with its To, Subject and Body filled in." width="2880" height="1800" data-path="images/studio/workflows/designer.png" />
</Frame>

## Build a new starter workflow

This workflow emails your service desk when someone submits the New starter request form from [Introduction to forms](/studio/forms/introduction).

<Steps>
  <Step title="Create the workflow">
    In Workflows, click **New Workflow**, name it `New starter setup` and click Create Workflow.

    <Frame>
      <img src="https://mintcdn.com/triggr/rFRD51HB_88hTzdJ/images/studio/workflows/new-workflow-dialog.png?fit=max&auto=format&n=rFRD51HB_88hTzdJ&q=85&s=8f0699ee1a225b9df576475b6e404d7a" width="512" alt="The Create New Workflow dialog with Workflow Name New starter setup, Type Primary, and Cancel and Create Workflow buttons." data-path="images/studio/workflows/new-workflow-dialog.png" />
    </Frame>
  </Step>

  <Step title="Add a form trigger">
    Drag **Trigger** from Flow Control onto the canvas. Click **Add Trigger** and choose New starter request as the Form. A new trigger's type is already Form.

    <Frame>
      <img src="https://mintcdn.com/triggr/rFRD51HB_88hTzdJ/images/studio/workflows/trigger.png?fit=max&auto=format&n=rFRD51HB_88hTzdJ&q=85&s=75ccbbb93ef348f99a4988b8ac7bbae5" width="383" alt="The Trigger step panel with one trigger, Trigger 1, whose Trigger Type is Form and Form is New starter request, and an Add Trigger button." data-path="images/studio/workflows/trigger.png" />
    </Frame>
  </Step>

  <Step title="Add the steps">
    Drag Generate Custom Reference (Utilities), Send Email (Communication) and Finish Workflow (Flow Control) below it, then drag from the dot under each step to the dot on top of the next. To find a step, type its name in Search components.

    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/canvas-new-starter.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=5cd0face1edfbaeb21ff6867df38e622" width="400" alt="The canvas with Trigger, Generate Custom Reference, Send Email and Finish Workflow joined in a line from top to bottom." data-path="images/studio/workflows/canvas-new-starter.png" />
    </Frame>
  </Step>

  <Step title="Fill in the email">
    Click **Send Email** and fill in Setup, leaving Sending Profile empty to send from Triggr:

    * To: your service desk's address
    * Subject: `New starter: {{ ctx.params.firstName }} {{ ctx.params.lastName }}`
    * Body: `Joining {{ ctx.params.department }}. Reference: {{ ctx.steps['Generate Custom Reference'].reference }}`

    <Frame>
      <img src="https://mintcdn.com/triggr/rFRD51HB_88hTzdJ/images/studio/workflows/send-email-setup.png?fit=max&auto=format&n=rFRD51HB_88hTzdJ&q=85&s=59eb20fad6065494340024e117facbce" width="383" alt="The Send Email step's Setup tab: Sending Profile Select..., To servicedesk@example.com, Subject New starter: followed by the first and last name templates, Body Joining the department template with a reference from the Generate Custom Reference step, and an empty Attachments field with a Pick from library link." data-path="images/studio/workflows/send-email-setup.png" />
    </Frame>
  </Step>

  <Step title="Save and test it">
    Click **Save** at the bottom of the canvas (or press ⌘S or Ctrl+S), then **Manual Trigger**. Enter test answers and click **Trigger Workflow**.

    <Frame>
      <img src="https://mintcdn.com/triggr/rFRD51HB_88hTzdJ/images/studio/workflows/manual-trigger-new-starter.png?fit=max&auto=format&n=rFRD51HB_88hTzdJ&q=85&s=f247853ddd63c8ec102d96160114545a" width="560" alt="The Trigger Workflow dialog: Enter workflow parameters as JSON, an editor containing firstName Sam, lastName Taylor and department Finance, and Cancel and Trigger Workflow buttons." data-path="images/studio/workflows/manual-trigger-new-starter.png" />
    </Frame>
  </Step>

  <Step title="Read the run">
    The run opens on the right. Click a step to see its Output.

    <Frame>
      <img src="https://mintcdn.com/triggr/rFRD51HB_88hTzdJ/images/studio/workflows/test-run.png?fit=max&auto=format&n=rFRD51HB_88hTzdJ&q=85&s=03dfcd73312f6661343768279a15eed4" width="600" alt="The run panel showing Completed, an Execution ID, and Trigger, Generate Custom Reference, Send Email and Finish Workflow each with a green dot." data-path="images/studio/workflows/test-run.png" />
    </Frame>
  </Step>
</Steps>

## Pass data between steps

`ctx.params` holds the trigger's data and `ctx.steps['Step name']` holds an earlier step's output. In a one-line field such as Subject, type `{{ ctx.params.` to pick one of the trigger form's fields, or `{{ ctx.steps['` to pick an earlier step. See [Data and expressions](/studio/workflows/expressions) for every value you can read, and [Step types](/studio/workflows/steps) for every step and its output fields.

## Triggers

A workflow starts from a Form submission, a Cron schedule in UTC, a Webhook POST, Manual Trigger, another workflow, an internal app or a PSA ticket. See [Workflow triggers](/studio/workflows/triggers).

## Runs

Runs in the designer header lists this workflow's runs, and Workflows > Executions lists every run. A run is Completed when it reaches Finish Workflow with Outcome Success, stays Running while it waits for an approval, a manual step or a delay, and is Failed when a step fails, it reaches Finish Workflow with Outcome Fail, or someone clicks Terminate Run. End every path with Finish Workflow: a path without one leaves the run Running. See [Debug a failed run](/studio/workflows/debugging) and [Approvals and manual steps](/studio/workflows/approvals-and-manual-steps).

## Troubleshooting

<AccordionGroup>
  <Accordion title="A step fails with “Missing or invalid variable”">
    The run has no value at that path. Check it against the form's Field ID, your test JSON or the step's name, and click Validate to find other mistakes before you run.
  </Accordion>

  <Accordion title="New Workflow or Manual Trigger is missing">
    Ask an admin for permission to edit and run workflows.
  </Accordion>
</AccordionGroup>

Next: [Introduction to internal apps](/studio/internal-apps/introduction).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.