I use the expression {{$evaluateExpression($node[’Cron’].data[‘key’])}} in this flow but fail.
So How can I get the data in execute workflow which has a cron trigger.
Is the workflow which trigger by Cron is not controlled by other workflow, even if it as an execute workflow node in other workflow ? So I can’t get any data passed from other workflow in execute workflow node which triggered by Cron node?
Hi @vanessa, when using the Execute Workflow node, the data gets passed to the Start node of the executed workflow. So you’d need to connect your Start node to wherever you want to read the data.
Thanks.I had tried this and It is succeed.But some problems occur, the workflow will execute right now as the parent workflow execute.Is there another solution can fix this?
this is Execute Workflow node
Do you want to trigger the sub-workflow (Triggered by the Execute Workflow1 node) by the Cron node as well? It should get triggered by the Cron node too. Can you check if that workflow is active?
Yes, It will be triggered by the Cron node too, but the data which come from parent-workflow I got from Start node will be undefined when Cron node trigger the sub-workflow.
This would be the intended behaviour though. When using the Execute Workflow node, the subworkflow triggered by this node will run straight away (with data being passed on to its Start node).
So Is this means when the Cron trigger the sub-workflow, it can’t get any data from Start Node, because of Start node having no data now? Is there a solution that I can store the data from Start Node, so that I can use the data when Cron node trigger
Exactly, these executions would be separate from each other and are not related in any way. The Cron node does not have access to previous executions’ data and you would need some kind of database for such scenarios. E.g. have one workflow write data to the database and have your other workflow (triggered by Cron) read from it whenever they are executed.