# How can I get a workflow state/status from an external application in java?

**URL:** <https://community.temporal.io/t/how-can-i-get-a-workflow-state-status-from-an-external-application-in-java/390>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [August 7, 2020, 4:50pm UTC](https://community.temporal.io/t/how-can-i-get-a-workflow-state-status-from-an-external-application-in-java/390 "2020-08-07T16:50:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![saket\_kothari](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/saket_kothari/32/53_2.png) [@saket\_kothari](https://community.temporal.io/u/saket_kothari)\
**Post date:** [August 7, 2020, 4:50pm UTC](https://community.temporal.io/t/how-can-i-get-a-workflow-state-status-from-an-external-application-in-java/390/1 "2020-08-07T16:50:47Z")

</div>

Hi Team,  
I want to know my workflow state whether it has failed/succeeded/in\_progress?  
Can you please let me know how can I do it from an external program in java?

---

<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:** [August 7, 2020, 4:53pm UTC](https://community.temporal.io/t/how-can-i-get-a-workflow-state-status-from-an-external-application-in-java/390/2 "2020-08-07T16:53:57Z")

</div>

The following did it for me:

```java
String workflowId = "c1d901c1-49ca-400b-bb0f-ca5cd9eb35c9";
WorkflowServiceStubs service = WorkflowServiceStubs.newInstance();
WorkflowServiceGrpc.WorkflowServiceBlockingStub stub = service.blockingStub();
DescribeWorkflowExecutionRequest request =
    DescribeWorkflowExecutionRequest.newBuilder()
        .setNamespace("UnitTest")
        .setExecution(WorkflowExecution.newBuilder().setWorkflowId(workflowId))
        .build();
DescribeWorkflowExecutionResponse response = stub.describeWorkflowExecution(request);
System.out.println(response.getWorkflowExecutionInfo().getStatus());

```

---

<div class="post-metadata">

**Author:** ![saket\_kothari](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/saket_kothari/32/53_2.png) [@saket\_kothari](https://community.temporal.io/u/saket_kothari)\
**Post date:** [August 7, 2020, 4:59pm UTC](https://community.temporal.io/t/how-can-i-get-a-workflow-state-status-from-an-external-application-in-java/390/3 "2020-08-07T16:59:39Z")

</div>

Hi Maxim,  
I am using cadence java client sdk (2.7.1),so I am not seeing some classes you wrote above.

---

<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:** [August 7, 2020, 5:01pm UTC](https://community.temporal.io/t/how-can-i-get-a-workflow-state-status-from-an-external-application-in-java/390/4 "2020-08-07T17:01:21Z")

</div>

Cadence has a similar DescribeWorkflowExecution API. It belongs to [WorkflowServiceTChannel](https://github.com/uber/cadence-java-samples/blob/822d26d1642ca4becf0c0b4aae6c2dd9ca7e5348/src/main/java/com/uber/cadence/samples/common/RegisterDomain.java#L37).

---

<div class="post-metadata">

**Author:** ![saket\_kothari](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/saket_kothari/32/53_2.png) [@saket\_kothari](https://community.temporal.io/u/saket_kothari)\
**Post date:** [August 7, 2020, 5:06pm UTC](https://community.temporal.io/t/how-can-i-get-a-workflow-state-status-from-an-external-application-in-java/390/5 "2020-08-07T17:06:45Z")

</div>

Thanks Maxim.
