Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Start a child workflow in Started Mode With JS.

sourabhk3112
Level 2
Level 2

Hi Team,

I am facing Problem while calling a child workflow with "xtk.workflow.PostEvent". After child workflow completes it moved to Finished state but for next  Signal from parent workflow it will not hit it because it is in Finished mode. Is there any logic to Make sure a workflow is always in started mode.

Regards,

Sourabh

Amit_Kumar

5 Replies
Adhiyan
Employee
Employee

Hi Sourabh,

You need to call the other workflow using the following syntax xtk.workflow.PostEvent ("wkf_internalName", name_activity) .

So if you have a signal on the other workflow which you want to call using PostEvent is should be like :xtk.workflow.PostEvent ("wkf_internalName", "signal") .

Then you need to make sure the workflow with signal activity is started and signal being the first activity.

Regards,

Adhiyan

sourabhk3112
Level 2
Level 2

Hi Adhyan

Thanks for quick response . I tried calling Child workflow by putting  xtk.workflow.PostEvent at the end but it will hit my Signal . But I have to make sure that my workflow goes to started mode but it will not hit the signal It gets hitted by parent workflow.

Regards,

Sourabh Kumar

Adhiyan
Employee
Employee

Hello Sourabh,

Please use the xtk.workflow.start method before calling the PostEvent method to start the workflow via JS.

Regards,
Adhiyan

sourabhk3112
Level 2
Level 2

Thanks Adhiyan !

I tried that also but not working. I think I am not using correct syntax.

If possible can you please share the proper syntax.

Regards,

Sourabh

Vapsy
Employee
Employee

Hi Sourabh,

Can you please post a screenshot of your workflow that hosts external signal to this forum page.

What is the build you are using. A screenshot of that as well for confirmation.

Also is possible add the workflow as a package here or inbox me and Adhiyan with the package details so that we can see why it is going to stopped state every single time.

Regards,
Vipul