---
title: "run(_:withKey:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/sknode/run(_:withkey:)"
---

# run(_:withKey:)

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

## Declaration

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

## Parameters

- `action`: The action to perform.
- `key`: A unique key used to identify the action.

## Mentioned in

Controlling Actions Precisely by Using Names

## Discussion

Discussion This method is identical to 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.

## See Also

### Running Actions

- [Getting Started with Actions](spritekit/getting-started-with-actions.md)
- [run(_:)](spritekit/sknode/run(_:).md)
- [run(_:completion:)](spritekit/sknode/run(_:completion:).md)
- [speed](spritekit/sknode/speed.md)
- [isPaused](spritekit/sknode/ispaused.md)
- [action(forKey:)](spritekit/sknode/action(forkey:).md)
- [hasActions()](spritekit/sknode/hasactions().md)
- [removeAllActions()](spritekit/sknode/removeallactions().md)
- [removeAction(forKey:)](spritekit/sknode/removeaction(forkey:).md)
