> ## 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.

# Debug a failed run

> Find a failed Studio workflow run, read the step that failed, fix it and run it again, and look up common error messages.

The red step in a failed run says why. This example follows a disk-space alert workflow whose email step failed; [Common errors](#common-errors) lists the messages you're most likely to meet.

<Frame caption="Debug a failed run: find the failed run, read the step's error, fix the step and retry the run (1:23).">
  <video controls preload="none" playsInline className="w-full aspect-video rounded-xl" poster="/images/videos/studio-debugging.jpg" src="https://mintcdn.com/triggr/GxrCQFDFNLmEMyJ1/images/videos/studio-debugging.mp4?fit=max&auto=format&n=GxrCQFDFNLmEMyJ1&q=85&s=330d389b7c59eb3be23c99ad814e8547" data-path="images/videos/studio-debugging.mp4" />
</Frame>

## Find the run

<Steps>
  <Step title="Open the workflow's runs">
    Click **Runs** in the designer, or on the workflow's row in Workflows, and filter by Status and Date Range. It shows the last 24 hours until you change Date Range.

    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-runs.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=43580e7e1360a972bd00d2eb9a98cccd" alt="The Runs page for Docs sample – debugging: Search runs, Status filters for Completed, Running, Failed and Pending, Date Range set to Last 24 hours, a chart of Successful, Running and Failed runs, and a table with one Completed and one Failed run, each with a View button." width="2880" height="910" data-path="images/studio/workflows/debug-runs.png" />
    </Frame>
  </Step>

  <Step title="Or search every workflow">
    **Workflows > Executions** lists runs from all workflows. Filter by status or client, or search for an execution or workflow ID.

    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-executions.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=238cf2d7f212a4e6132d4a497d6fafeb" alt="The Workflow Executions page with a Search executions box, All Statuses and All Clients filters, and a table of two Docs sample – debugging runs, one Completed and one Failed, each with a View button." width="2332" height="706" data-path="images/studio/workflows/debug-executions.png" />
    </Frame>
  </Step>
</Steps>

If Runs is missing, ask an admin for the View Executions permission.

## Read the failed run

<Steps>
  <Step title="Open the run">
    Click **View**. The Execution Timeline lists each step the run reached; the red one failed. Click **Initial Context** to see what the trigger sent, under `params`.

    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-run-details.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=e6546e65f5764796083346bdcad94043" alt="A Failed run with Retry Workflow and Refresh buttons, an Execution Timeline with Trigger in green and Send Email in red, and Initial Context expanded to show params device ACME-DC01 and freeGb 4, and metadata source manual." width="2880" height="1662" data-path="images/studio/workflows/debug-run-details.png" />
    </Frame>
  </Step>

  <Step title="Read the error">
    Click the red step: its Output holds the error.

    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-step-error.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=b4407578beeda02290995fd9f9f5cf6e" width="600" alt="The Send Email step panel with Status error, Duration 5s, Type send_email and an Output of error Template Error, message Missing or invalid variable: siteName, step_type send_email." data-path="images/studio/workflows/debug-step-error.png" />
    </Frame>

    Here the email body uses `{{ ctx.params.siteName }}` and the alert didn't send `siteName`.
  </Step>

  <Step title="See it on the canvas">
    In the designer, click **Debug** and choose the run. The failed step is outlined in red, and each step's Debug tab shows that run's output and context.

    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-step-debug-tab.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=6cb80c39113ed74c6a5cdc7905167924" width="520" alt="The designer with Debug highlighted, the Send Email step outlined in red, and its Debug tab showing Error, Duration 5s, the Template Error output, and Context After Execution with the run's params." data-path="images/studio/workflows/debug-step-debug-tab.png" />
    </Frame>
  </Step>
</Steps>

## Fix it and run it again

<Steps>
  <Step title="Fix the cause">
    Change the step, or the system that starts the run, then click **Save**. Runs always use the last saved version.
  </Step>

  <Step title="Test with the failed run's input">
    Click **Manual Trigger** and paste the corrected `params` from Initial Context.

    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-rerun-manual-trigger.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=d31d72c64701f31fbc1377b34dc9bb7c" width="560" alt="The Trigger Workflow dialog with device ACME-DC01, siteName Head Office and freeGb 4, and a Trigger Workflow button." data-path="images/studio/workflows/debug-rerun-manual-trigger.png" />
    </Frame>
  </Step>

  <Step title="Check every step is green">
    <Frame>
      <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-rerun-completed.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=008e5b569f2d6fe5a7699207f9676976" width="600" alt="The run panel showing Completed, an Execution ID, and Trigger, Send Email and Finish Workflow each with a green dot." data-path="images/studio/workflows/debug-rerun-completed.png" />
    </Frame>
  </Step>
</Steps>

To rerun the original input unchanged, click **Retry Workflow** on the failed run: it starts a new run of the latest saved version with the same input and client.

<Frame>
  <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/debug-retry.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=a1dd3f230dc779a59663f0bccc9a2036" width="512" alt="The Retry Workflow Execution dialog: Are you sure you want to retry this workflow execution? This will create a new execution with the same initial context. Cancel and Retry buttons." data-path="images/studio/workflows/debug-retry.png" />
</Frame>

A failing step is tried once more after 5 seconds before the run fails, so a call that reached the other system may have landed twice.

## Stop a stuck run

A run stays Running while a step waits: an approval, a manual step, a delay, an awaited workflow or an on-premises agent. Open it to see which step it's on, and click **Terminate Run** to stop it as Failed.

<Frame>
  <img src="https://mintcdn.com/triggr/XztmSfsoAUpshfIO/images/studio/workflows/manual-step-run-waiting.png?fit=max&auto=format&n=XztmSfsoAUpshfIO&q=85&s=18f3e8b8ea03122ccb684bfaba615468" alt="A Running run with Terminate Run and Refresh buttons and an Execution Timeline of Trigger, Manager approval, Condition and Order laptop." width="2880" height="1024" data-path="images/studio/workflows/manual-step-run-waiting.png" />
</Frame>

## Catch failures early

* An admin can send the `execution.failed` event to your own systems from **Settings > Webhooks**. See [API keys and webhooks](/studio/settings/api-and-webhooks).
* The Dashboard's Execution Stats (Past 7 Days) charts failed runs across your organisation.
* An AI tool connected through [MCP](/studio/mcp) can rank failures with `get_workflow_failure_stats` and show each integration call's URL, status and response with `list_api_request_logs`.

## Common errors

The failed step's Output holds the message, sometimes after a code such as `internal:` or `failed_precondition:`.

<AccordionGroup>
  <Accordion title="“Missing or invalid variable: …”">
    No value at that path: the trigger didn't send it, an earlier step didn't return it or ran on another branch, or the name or capitals differ. Compare with Initial Context and the earlier step's Output.
  </Accordion>

  <Accordion title="“no … integration is configured for this client. Refusing to fall back to the organisation-level configuration …”">
    The integration has a separate login per client and the run's client has none. Add it on the integration's Per-Client Configuration card in Integrations, or check the run set the right client.
  </Accordion>

  <Accordion title="“failed to get integration configuration (both tenant-specific and base): no matching integration found”">
    The integration isn't set up. Configure it in Integrations using its [guide](/integrations/overview).
  </Accordion>

  <Accordion title="“client ID not found in tenant or base configuration” (or API key, token, username / password)">
    A field the integration needs is empty. Fill it in on the Base Configuration or the client's per-client configuration.
  </Accordion>

  <Accordion title="“access token expired and no refresh token available”">
    The integration's sign-in has lapsed. Open it in Integrations and click **Authorize** again.
  </Accordion>

  <Accordion title="“integration request failed with status code: 401 …” or “… 403 …”">
    The vendor refused Triggr's credentials (401) or the account lacks a permission (403); its message follows `Response:`. Renew the credential or grant the role in the integration's guide.
  </Accordion>

  <Accordion title="“integration request failed with status code: 429 …” or 5xx">
    The vendor is rate-limiting you or having problems. Add a Delay inside a For Loop, or Retry Workflow later.
  </Accordion>

  <Accordion title="“failed to execute HTTP request: … context deadline exceeded”">
    The vendor didn't answer in time or couldn't be reached. Check it's reachable from the internet and allow [Triggr's IP addresses](/security/ip-allowlist) through any firewall or vendor allowlist.
  </Accordion>

  <Accordion title="“refusing to connect to blocked IP address …”">
    The address resolves to a private IP, which Triggr doesn't call. Publish the system at a public address, or reach it with Execute PowerShell through the [desktop agent](/desktop-agent/overview).
  </Accordion>

  <Accordion title="“microsoftGDAP integration is not configured for tenant '…'”">
    The client isn't linked to GDAP; with `microsoftSAM`, it hasn't approved the per-client app. See the [Microsoft and GDAP FAQ](/core/reference/microsoft-faq#errors-you-might-see).
  </Accordion>

  <Accordion title="“tenant ID is required for … requests”, “client not found in context” or “client.id not found in context”">
    The step needs a client and the run has none. Add Set Client By ID or Set Client From Form before it.
  </Accordion>

  <Accordion title="“org.defaultMicrosoftConnection not found or empty”">
    Choose a Connection Type on the step, or add `defaultMicrosoftConnection` (`microsoftGDAP`, `microsoftSAM` or `CIPP`) in Settings > Org Variables.
  </Accordion>

  <Accordion title="“Microsoft Graph API returned status code 403 …: Authorization_RequestDenied”">
    Triggr's access to the tenant lacks a role or permission for this action. Check the client's GDAP roles against [Recommended roles](/integrations/microsoft-graph/recommended-roles).
  </Accordion>

  <Accordion title="“Triggr is fixing this automatically … re-run in a few minutes.”">
    Triggr is repairing a consent or permission gap. Wait a few minutes, then click **Retry Workflow**.
  </Accordion>

  <Accordion title="“The GDAP relationship with this client has expired or been removed — renew it in Partner Center.”">
    Renew it in Partner Center, then retry the run.
  </Accordion>

  <Accordion title="“failed to get tenant details: tenant not found”">
    Set Client By ID got a value that isn't one of your clients' IDs. Check the earlier steps' Output.
  </Accordion>

  <Accordion title="An Execute PowerShell step stays Running, or “the on-prem agent did not report a result before the step timeout — check that it's online”">
    The client's [desktop agent](/desktop-agent/overview) is offline. Terminate the run or retry once it's online, and use Execute PowerShell (Timeout) or Check Agents Online so an offline agent can't hold a run.
  </Accordion>

  <Accordion title="My PowerShell step is green but the script failed">
    A script error doesn't fail the step: its output has `completed: false` and `error`. Branch on `completed`, or use the Failed branch of Execute PowerShell (Timeout).
  </Accordion>

  <Accordion title="“SQL query failed: invalid SQL query: pq: …”">
    `relation "…" does not exist` is a wrong table name, `syntax error` a typo, and `permission denied` a missing right for the database user.
  </Accordion>

  <Accordion title="“invalid email format: …”">
    To resolved to something that isn't an email address, usually an empty or misspelt variable.
  </Accordion>

  <Accordion title="“failed to execute JavaScript condition: …”">
    The condition read a field of something missing (`Cannot read property … of undefined`). Check the path in the earlier step's Output.
  </Accordion>

  <Accordion title="The run failed but no step is red">
    It ended at a Finish Workflow set to Fail; its Comment says why.
  </Accordion>

  <Accordion title="The run never leaves Running">
    A step is waiting (see [Stop a stuck run](#stop-a-stuck-run)), or the path has no Finish Workflow: a run only completes when it reaches one.
  </Accordion>
</AccordionGroup>


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