<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Automator",
  "identifier" : "/documentation/Automator/AMWorkspace/runWorkflow(atPath:withInput:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Automator"
    ],
    "preciseIdentifier" : "c:objc(cs)AMWorkspace(im)runWorkflowAtPath:withInput:error:"
  },
  "title" : "runWorkflow(atPath:withInput:)"
}
-->

# runWorkflow(atPath:withInput:)

Loads and runs the specified workflow file.

```
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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)