How to query Activity Attempt ID in CLI or WorkflowClient?

Say I have a workflow that’s running or completed, and I want to get information from a specific activity and its latest attempt_id (either from the CLI or through the WorkflowClient), how would I get the attempt_id?

I have tried using the workflow show, workflow describe and workflow activity commands but none of them show the latest attempt_id used by an activity.

The reason is that the activity writes to a path made up of workflowId_runId_attemptId, and I’m trying to assemble the path from a different service by querying information about the workflow.

1 Like

I would just make the activity to return the id as part of its result. Then you can use the query feature to return the value.

1 Like