<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKNode/run(_:withKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKNode(im)runAction:withKey:"
  },
  "title" : "run(_:withKey:)"
}
-->

# run(_:withKey:)

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

```
func run(_ action: SKAction, withKey key: String)
```

## Parameters

`action`

The action to perform.

`key`

A unique key used to identify the action.

## Discussion

This method is identical to [`run(_:)`](/documentation/SpriteKit/SKNode/run(_:)), but the action is stored so that it can be retrieved later. If an action using the same key is already running, it is removed before the new action is added.

---

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)