How to know if running inside temporal workflow when using TypeScript

102 Views Asked by At

How can I know if I'm running inside temporal workflow when using the TypeScript SDK

1

There are 1 best solutions below

0
Raz Luvaton On BEST ANSWER

You can use this:

import { inWorkflowContext } from '@temporalio/workflow';

if(inWorkflowContext()) {
   // ...
}