Manually setting activity_id

The Python API doc about workflow.start_activity mentions that the activity_id argument “is an advanced setting that should not be set unless users are sure they need to. Contact Temporal before setting this value.”

How do I set this value properly? I understand that there are probably some sort of uniqueness requirements, but which one of the following is true?

  1. Activity IDs must be unique across all namespaces
  2. Activity IDs must be unique across all workflow executions within current namespaces
  3. Activity IDs must be unique across all workflow executions of the current workflow type
  4. Activity IDs must be unique within the current workflow execution

Besides uniqueness, are there any other requirements?

I asked because multiple activities within the same workflow execution might use same activity type. Setting activity IDs manually give me visual cues about each activity, especially when viewing from Temporal UI.

An activity ID is not usually meant to be set just as a visual clue and I am not sure that is a good use case for setting it. The only common use case we see it used is for an advanced feature called asynchronous activity completion. Consider using activity input as a visual clue.

For some details on uniqueness of activity ID, see the docs

Thanks for the info! Some of our activities have long inputs. We use activity ID as “summary” of the activity. Good to know that activity IDs only need to be unique among the open activity executions within each workflow run - that’s easy to achieve, and it doesn’t make sense to have duplicate IDs within same workflow run anyway, IMO.