---
title: "runWorkflow(atPath:withInput:)"
framework: automator
role: symbol
role_heading: Instance Method
path: "automator/amworkspace/runworkflow(atpath:withinput:)"
---

# runWorkflow(atPath:withInput:)

Loads and runs the specified workflow file.

## Declaration

```swift
func runWorkflow(atPath path: String!, withInput input: Any!) throws -> Any
```

## Parameters

- `path`: A path that specifies the location of the workflow file.
- `input`: The input for the first action in the workflow. Pass nil if the first action doesn’t need input.

## Return Value

Return Value nil if an error occurs or if the action completes successfully without producing output; otherwise, the output of the last action in the workflow.
