# How to query Activity Attempt ID in CLI or WorkflowClient?

**URL:** <https://community.temporal.io/t/how-to-query-activity-attempt-id-in-cli-or-workflowclient/704>\
**Category:** Community Support\
**Tags:** java-sdk, cadence\
**Created:** [October 6, 2020, 3:35pm UTC](https://community.temporal.io/t/how-to-query-activity-attempt-id-in-cli-or-workflowclient/704 "2020-10-06T15:35:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![visaals](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/visaals/32/120_2.png) [@visaals](https://community.temporal.io/u/visaals)\
**Post date:** [October 6, 2020, 3:35pm UTC](https://community.temporal.io/t/how-to-query-activity-attempt-id-in-cli-or-workflowclient/704/1 "2020-10-06T15:35:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [October 6, 2020, 6:12pm UTC](https://community.temporal.io/t/how-to-query-activity-attempt-id-in-cli-or-workflowclient/704/3 "2020-10-06T18:12:13Z")

</div>

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.
