Unable to execute Flow. The logs report this error: Could not retrieve snapshot for test


Description

When you execute a Flow (either via Test or by triggering it) it doesn't execute. If you check the Node logs an error is recorded: Could not retrieve snapshot for test

Cause

Flow Designer ran into difficulties executing the Flow and you need to use the Node logs to work out what's wrong exactly. 

Resolution

For example, consider this log stack:

DEBUG: Flow Designer: Compiling flow TestFlow | Change

DEBUG: Flow Designer: Step Get Catalog Variables Step Created with an input count of 3 and an output count of 0
DEBUG: Flow Designer: Step Get Catalog Variables Step Created with an input count of 3 and an output count of 5
DEBUG: Flow Designer: Action created with an input count of 3 an output count of 5

DEBUG: Flow Designer: Step Lookup Record step Created with an input count of 5 and an output count of 2
DEBUG: Flow Designer: Step Lookup Record step Created with an input count of 5 and an output count of 2
DEBUG: Flow Designer: Action created with an input count of 5 an output count of 2

DEBUG: Flow Designer: Step Create Task step Created with an input count of 4 and an output count of 2
DEBUG: Flow Designer: Action created with an input count of 3 an output count of 2

DEBUG: Input param1 assigned with a reference count of 1
DEBUG: Input param2 assigned with a reference count of 1

SEVERE *** ERROR *** Flow Designer: null
SEVERE *** ERROR *** Flow Designer: Could not retrieve snapshot for test
com.glide.flow_trigger.engine.FlowSnapshotPlanRetriever.retrieve(FlowSnapshotPlanRetriever.java:33)
com.snc.process_flow.engine.serialization.PlanProxy.plan(PlanProxy.java:43)


What it's doing here is going through the various actions of the Flow and trying to compile everything. You can check that in the Flow and you'd see something like:

1) Get Catalog Variables: OK
2) Lookup Record: OK
3) Create Task: OK

So up to this point everything works okay. It's likely it fails on the next step in the Flow execution. The 'null' in the error is likely a missing input value. The logs say this:

DEBUG: Input param1 assigned with a reference count of 1
DEBUG: Input param2 assigned with a reference count of 1

They are inputs for the next step. The first two (param1 and param2) work okay but the third one fails.