How to make a workflow run for an infinitely long duration when running it using command line?

319 views Asked by At

I am running a Cadence workflow using command line. I don't want my workflow to timeout (ie, I want it to run it for an infinitely long duration). How can I do so?

1

There are 1 answers

0
Long Quanzheng On

You can specify the startToCloseTimeout to a very large number, e.g. 100 years can represent infinite duration for you.

Also there are two ways to start workflows using Command line -- start or run.

./cadence --address <> --domain <> workflow run  --tl helloWorldGroup --wt <WorkflowTypeName> --et 31536000 -i '<inputInJson>'

or 

./cadence --address <> --domain <> workflow start --tl helloWorldGroup --wt <WorkflowTypeName> --et 31536000 -i '<inputInJson>'

Note that et is short for execution_timeout which is the startToCloseTimeout in seconds.

So Start would return once server accepts the start request. Run will wait for workflow to complete, and return the result at the end. In your case, you need to use Start because you don't know when the workflow will complete. But if you also want to get the workflow result after it's started, you can use observe command.

./cadence --address <> --domain <> workflow observe --workflow_id <>