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

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?

The following did it for me:

String workflowId = "c1d901c1-49ca-400b-bb0f-ca5cd9eb35c9";
WorkflowServiceStubs service = WorkflowServiceStubs.newInstance();
WorkflowServiceGrpc.WorkflowServiceBlockingStub stub = service.blockingStub();
DescribeWorkflowExecutionRequest request =
DescribeWorkflowExecutionResponse response = stub.describeWorkflowExecution(request);

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

Cadence has a similar DescribeWorkflowExecution API. It belongs to WorkflowServiceTChannel.

Thanks Maxim.