---
title: "insertAction(_:at:)"
framework: automator
role: symbol
role_heading: Instance Method
path: "automator/amworkflow/insertaction(_:at:)"
---

# insertAction(_:at:)

Inserts the specified action at the specified position of the receiving workflow.

## Declaration

```swift
func insertAction(_ action: AMAction, at index: Int)
```

## Parameters

- `action`: The action to insert.
- `index`: The position in the receiver at which to insert the action. If the position is invalid, this method does nothing.

## Discussion

Discussion The workflow retains the action but does not copy it.

## See Also

### Manipulating the Workflow’s Actions

- [addAction(_:)](automator/amworkflow/addaction(_:).md)
- [moveAction(at:to:)](automator/amworkflow/moveaction(at:to:).md)
- [removeAction(_:)](automator/amworkflow/removeaction(_:).md)
