Backend workflow in backend worklow

Hello,

Just wondering if you could help me with an issue. Indeed, I created a workflow in a workflow (in the example, once a contract is validated, it generates a certificate (step 10). My issue is that it seems that data are not pushed to the certificate so it generates a pdf without data inside. Any idea why would be welcome !

Many thanks and happy new year !

It’s probably because the execution rules that bubble uses for the actions in your workflow.
From the execution rules documentation:

Backend workflows are triggered as soon as the workflow is triggered, independently from steps. For example, a “Schedule API Workflow’” action will be triggered as soon as the workflow is triggered even if it is placed last in the workflow action sequence.
Custom events run in sequence, not parallel. If Workflow 1 triggers a custom event that starts Workflow 2, Workflow 2 will complete before the remaining actions in Workflow 1 run.

Basically if you need to wait the full execution of some actions you need to create separate custom events and trigger them in sequence.

1 Like

Indeed you have a good point. What is not clear to me is that I now created a custom event / worflow in the backend (see (TEST), but

I don’t see this custom workflow in the front end, so I don’t know how to trigger it

So, I probably missed something

A backend custom WF can only be trigerred in the backend. To trigger a WF from Frontend, you need to create an api Wf in backend.

In your case (first screenshots) if the data is not coming, add a delay in your schedule pdf wf (and watch for logs to see what’s going on - I always create a “admin-log” table in my db, and when I don’t understand why data doesn’t come somewhere, I add a “create an admin log” where I store data to see if it s here or not)

1 Like

You have a backend workflow that you schedule from the frontend.
Your backend workflow is modifying data + scheduling another workflow that requires that data.
Move the logic that modifies data in a custom event, move the logic that requires the data in a second custom event.
From the first backend workflow trigger the 2 events one after the other, they will run in sequence.
The logic from the frontend remains unchanged: you still schedule the first backend workflow.

1 Like

Many thanks for your answer, really appreciated !

Happy to help :slight_smile:

Cheers
Mariano

This topic was automatically closed after 70 days. New replies are no longer allowed.