<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Automator",
  "identifier" : "/documentation/Automator/AMWorkflow/insertAction(_:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Automator"
    ],
    "preciseIdentifier" : "c:objc(cs)AMWorkflow(im)insertAction:atIndex:"
  },
  "title" : "insertAction(_:at:)"
}
-->

# insertAction(_:at:)

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

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

The workflow retains the action but does not copy it.

---

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)