> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/powershell-commands/invoke-psuworkflow.md).

# Invoke-PSUWorkflow

Invoke-PSUWorkflow runs a configured PowerShell Universal workflow by name, ID, or workflow object.

## SYNOPSIS

Runs a workflow in PowerShell Universal.

## SYNTAX

```powershell
Invoke-PSUWorkflow -Name <String> [-Parameters <Hashtable>] [-Environment <String>] [-Queue <String>] [-Wait] [-WaitTimeout <Int32>] [<ExecutionOptions>] [<ConnectionOptions>]
Invoke-PSUWorkflow -Id <Int64> [-Parameters <Hashtable>] [<ExecutionOptions>] [<ConnectionOptions>]
Invoke-PSUWorkflow -Workflow <Workflow> [-Parameters <Hashtable>] [<ExecutionOptions>] [<ConnectionOptions>]
```

`<ExecutionOptions>`: `[-WaitForDebugger] [-Environment <String>] [-Notes <String>] [-Credential <Variable>] [-Wait] [-Queue <String>] [-WaitTimeout <Int32>] [-Tags <Tag[]>] [-Silent]`. `<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies] [<CommonParameters>]`. Here `-Credential` is a PSU credential variable for workflow execution, not Management API Basic credentials.

## DESCRIPTION

Runs a configured workflow selected by name, ID, or workflow object (accepts pipeline input). Supply declared workflow inputs through `-Parameters`: unknown names cause an error. Override the execution environment or queue and optionally wait for completion. With `-Wait`, the cmdlet delegates to `Wait-PSUJob`; otherwise it returns the created job.

## EXAMPLES

```powershell
Invoke-PSUWorkflow -Name 'DailyMaintenance'
Invoke-PSUWorkflow -Name 'Deploy' -Parameters @{ Environment = 'Test' } -Wait
```

## PARAMETERS

| Parameter                | Description                                                                                          |
| ------------------------ | ---------------------------------------------------------------------------------------------------- |
| `-Name`                  | Required workflow name in the default parameter set; case-insensitive.                               |
| `-Id`                    | Required numeric workflow ID in the Id parameter set.                                                |
| `-Workflow`              | Workflow object; accepts pipeline input.                                                             |
| `-Parameters`            | Hashtable of declared workflow input values; unknown parameter names fail.                           |
| `-Environment`           | Execution environment override (alias `-PowerShellVersion`).                                         |
| `-Queue`                 | Execution queue or computer group (alias `-ComputerGroup`).                                          |
| `-Wait`                  | Waits for the workflow job to complete.                                                              |
| `-WaitTimeout`           | Timeout in seconds used when waiting; omitted or zero leaves the wait without this timeout override. |
| `-WaitForDebugger`       | Waits for debugger attachment before execution.                                                      |
| `-Notes`                 | Notes attached to the workflow job.                                                                  |
| `-Credential`            | PSU credential variable used for execution.                                                          |
| `-Tags`                  | Tags attached to the job.                                                                            |
| `-Silent`                | Suppresses output from the wait operation.                                                           |
| `-ComputerName`          | PSU Management API URL or host name (alias `-Uri`).                                                  |
| `-AppToken`              | Management API app token.                                                                            |
| `-UseDefaultCredentials` | Uses current Windows credentials.                                                                    |
| `-Integrated`            | Uses the in-process management client.                                                               |
| `-TrustCertificate`      | Ignores certificate validation errors.                                                               |
| `-Cookies`               | Reuses session authentication cookies.                                                               |

## RELATED LINKS

[Get-PSUWorkflow](/powershell-universal/powershell-commands/get-psuworkflow.md)

## PERMISSIONS

The access token requires `automation.workflows/execute` to run this cmdlet remotely. Retrieving a workflow first with `Get-PSUWorkflow` also requires `automation.workflows/read`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/powershell-commands/invoke-psuworkflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
