---
title: "updateActivity(uuid:adding:completion:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkworkoutbuilder/updateactivity(uuid:adding:completion:)"
---

# updateActivity(uuid:adding:completion:)

Adds metadata to a workout activity that you’ve already added to the workout builder.

## Declaration

```swift
func updateActivity(uuid UUID: UUID, adding metadata: [String : Any], completion: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

```swift
func updateActivity(uuid UUID: UUID, adding metadata: [String : Any]) async throws
```

## Parameters

- `UUID`: The workout activity’s universally unique identifier (UUID).
- `metadata`: A dictionary containing the metadata keys and values to add to the workout activity.
- `completion`: A callback handler that the system calls after updating the workout activity. The system calls the callback handler on an anonymous background queue. The callback handler takes the following parameters:

## Discussion

Discussion You can call this method multiple times to incrementally add metadata to the workout activity. The system merges the new metadata with any existing metadata using addEntries(from:). Calling this method after calling finishWorkout(completion:) fails with an error.

## See Also

### Managing workout activities

- [addWorkoutActivity(_:completion:)](healthkit/hkworkoutbuilder/addworkoutactivity(_:completion:).md)
- [updateActivity(uuid:end:completion:)](healthkit/hkworkoutbuilder/updateactivity(uuid:end:completion:).md)
- [workoutActivities](healthkit/hkworkoutbuilder/workoutactivities.md)
