---
title: "runAsynchronously(withInput:)"
framework: automator
role: symbol
role_heading: Instance Method
path: "automator/amaction/runasynchronously(withinput:)"
---

# runAsynchronously(withInput:)

Causes Automator to wait for notification that the action has completed execution, which allows the action to perform an asynchronous operation.

## Declaration

```swift
func runAsynchronously(withInput input: Any?)
```

## Parameters

- `input`: The input for the action. Should contain one or more objects compatible with one of the types specified in the action’s doc://com.apple.automator/documentation/Automator/AMAction/selectedInputType property.

## Discussion

Discussion Override this method in actions that need to make asynchronous calls. After runAsynchronously(withInput:) is invoked, Automator doesn’t continue until the action invokes finishRunningWithError(_:). In your override of this method, you can make an asynchronous call, wait to be notified of its completion, then invoke finishRunningWithError(_:) to signal to Automator that the action has completed. warning: Failure to invoke finishRunningWithError(_:) can cause a workflow to stall indefinitely. For actions that don’t need to make asynchronous calls, use runWithInput:fromAction:error: instead.

## See Also

### Controlling the Action

- [run(withInput:)](automator/amaction/run(withinput:).md)
- [finishRunningWithError(_:)](automator/amaction/finishrunningwitherror(_:).md)
- [willFinishRunning()](automator/amaction/willfinishrunning().md)
- [stop()](automator/amaction/stop().md)
- [reset()](automator/amaction/reset().md)
