<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNActionable/runAction(_:forKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(pl)SCNActionable(im)runAction:forKey:"
  },
  "title" : "runAction(_:forKey:)"
}
-->

# runAction(_:forKey:)

Adds an identifiable action to the list of actions executed by the node.

```
func runAction(_ action: SCNAction, forKey key: String?)
```

## Parameters

`action`

The action to be performed.

`key`

A unique key used to identify the action.

## Discussion

This method is identical to [`runAction(_:)`](/documentation/SceneKit/SCNActionable/runAction(_:)), but the action is stored and identified so that you can retrieve or cancel it later. If an action using the same key is already running, SceneKit removes it before adding the new action.

## See Also

[`action(forKey:)`](/documentation/SceneKit/SCNActionable/action(forKey:))

Returns an action associated with a specific key.

[`removeAction(forKey:)`](/documentation/SceneKit/SCNActionable/removeAction(forKey:))

Removes an action associated with a specific key.



---

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)