# Can we run the tctl commands in java sdk

**URL:** <https://community.temporal.io/t/can-we-run-the-tctl-commands-in-java-sdk/8989>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [July 28, 2023, 8:29am UTC](https://community.temporal.io/t/can-we-run-the-tctl-commands-in-java-sdk/8989 "2023-07-28T08:29:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tallam\_Hemanth](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tallam_hemanth/32/3446_2.png) [@Tallam\_Hemanth](https://community.temporal.io/u/Tallam_Hemanth)\
**Post date:** [July 28, 2023, 8:29am UTC](https://community.temporal.io/t/can-we-run-the-tctl-commands-in-java-sdk/8989/1 "2023-07-28T08:29:41Z")

</div>

I am trying to integrate the functionalities provided by tctl v1.17 command reference. How to do that. Any reference to those would be helpful  
I want flexibility to list workflows, find by status, find by workflow id, terminate workflow based on id,…

Any class or object that I can use like `.query(command I want to run)`

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [July 28, 2023, 2:23pm UTC](https://community.temporal.io/t/can-we-run-the-tctl-commands-in-java-sdk/8989/2 "2023-07-28T14:23:37Z")

</div>

Hello @Tallam_Hemanth

You can use the sdk directly to

- query workflows: `client.getWorkflowServiceStubs().blockingStub().listWorkflowExecutions()`
- terminate: `client.getWorkflowServiceStubs().blockingStub().terminateWorkflowExecution()`

And similar operations you do from tcld,

Antonio

---

<div class="post-metadata">

**Author:** ![Tallam\_Hemanth](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tallam_hemanth/32/3446_2.png) [@Tallam\_Hemanth](https://community.temporal.io/u/Tallam_Hemanth)\
**Post date:** [July 30, 2023, 6:47pm UTC](https://community.temporal.io/t/can-we-run-the-tctl-commands-in-java-sdk/8989/3 "2023-07-30T18:47:51Z")

</div>

Hi @antonio.perez  
Thanks, it is working. can I filter based on workflow status like running, completed, terminated or canceled.

and also example to terminate workflow with its workflow id, I was not able to create TerminateWorkflowExecutionRequest.

I would also like to know, how to fetch details of a particular workflow, what all activities were done their status all which we can see on temporal UI
