Whenever I try to start or execute a workflow from within the context of my HTTP API, the workflow remains in the Running
state and does not complete until I manually terminate it.
The same code to execute the workflow runs to completion when I run the client directly i.e node client.js
Is there something I need to do differently to make it work within the context of the HTTP API?
I have tried with both .execute
and .start
with the former blocking the HTTP response and the later returning the HTTP response.
const result = await client.execute(example, {
args: ['Temporal'],
taskQueue: 'hello-javascript1', //'tutorial',
// in practice, use a meaningful business id, eg customerId or transactionId
workflowId: 'wf-id-' + Math.floor(Math.random() * 1000),
});
const handle = await client.start(example, {
args: ['Temporal'],
taskQueue: 'hello-javascript2',
// in practice, use a meaningful business id, eg customerId or transactionId
workflowId: 'wf-id-' + Math.floor(Math.random() * 1000),
});