---
title: "runAction(_:forKey:)"
framework: scenekit
role: symbol
role_heading: Instance Method
path: "scenekit/scnactionable/runaction(_:forkey:)"
---

# runAction(_:forKey:)

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

## Declaration

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

## Parameters

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

## Discussion

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

### Related Documentation

- [action(forKey:)](scenekit/scnactionable/action(forkey:).md)
- [removeAction(forKey:)](scenekit/scnactionable/removeaction(forkey:).md)

### Running Actions

- [runAction(_:)](scenekit/scnactionable/runaction(_:).md)
- [runAction(_:completionHandler:)](scenekit/scnactionable/runaction(_:completionhandler:).md)
- [runAction(_:forKey:completionHandler:)](scenekit/scnactionable/runaction(_:forkey:completionhandler:).md)
