The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Sub-Flow Output Error in Flow?

Matthew Gill
Tera Expert

I am calling Sub-Flows within a Flow. The Sub-Flows return [status] which is a True/False variable. The Sub-Flow tests correctly, but when it is called from the Flow the Sub-Flow completes, returns the appropriate output when looking at the subflow execution details, but the Flow execution details show an error for the Sub-Flow task. 

It is as if the Sub-Flow output variable is not being passed back to the Flow. I have ensured that the variable types are the same, and the Sub-Flow is set to 'Wait for Completion). Any advice or guidance is appreciated. Thank you!

1 ACCEPTED SOLUTION

Matthew Gill
Tera Expert

Alright... Support figured out what the issue was.

 

Even though the error was being shown on the Sub-Flow call, the issue was actually failing on the Update Record Action. Specifically, updating the 'Actual Start' field. I was updating to " return ( new Date() ); "; however, that field requires a String, for some reason, and was not giving a good Error Code. The workaround is to update to " return ( new Date().toString() ); ". Not ideal, but it works...

 

Thanks everyone for helping!

View solution in original post

20 REPLIES 20

Unfortunately, it does not. I expand Flow Logs, and the Sub-Flow for error details. Those are attached in the other reply.

Thanks!

So I can see that the Subflow executes the "Assign Subflow outputs", what runtime value does the variable contain?

Does the error in the Flow generate something useful in the logs?

Runtime value is set to 'true' in the sub-flow execution, but seems to get lost before it can get back to the Flow.

find_real_file.png

find_real_file.png

 

Error is difficult for me to parse...

error updating the flow context: com.snc.process_flow.exception.ProcessAutomationException: error updating the flow context: com.snc.process_flow.engine.PFContext.updateContext(PFContext.java:658)
com.snc.process_flow.engine.PFContext.savePlan(PFContext.java:304)
com.snc.process_flow.engine.steps.ISavePlan.savePlan(ISavePlan.java:16)
com.snc.process_flow.engine.GlideProcessAutomation.persistPlan(GlideProcessAutomation.java:775)
com.snc.process_flow.engine.ProcessAutomation.run(ProcessAutomation.java:73)
com.snc.process_flow.engine.GlideProcessAutomation.runSync(GlideProcessAutomation.java:125)
com.snc.process_flow.engine.GlideProcessAutomation.runWithDomain(GlideProcessAutomation.java:235)
com.snc.process_flow.engine.GlideProcessAutomation.lambda$runAsUserSync$1(GlideProcessAutomation.java:204)
com.snc.process_flow.engine.PFSessionClone.run(PFSessionClone.java:68)
com.snc.process_flow.engine.GlidePFSession.runPlanAsUserSession(GlidePFSession.java:42)
com.snc.process_flow.engine.GlideProcessAutomation.runAsUserSync(GlideProcessAutomation.java:202)
com.snc.process_flow.engine.GlideProcessAutomation.messageFlow(GlideProcessAutomation.java:286)
com.snc.process_flow.engine.GlideProcessAutomation.messageFlow(GlideProcessAutomation.java:270)
com.snc.process_flow.engine.ProcessHubEventHandler.doSendMessage(ProcessHubEventHandler.java:453)
com.snc.process_flow.engine.ProcessHubEventHandler.process(ProcessHubEventHandler.java:111)
com.snc.process_flow.engine.ProcessHubEventHandler.process(ProcessHubEventHandler.java:83)
com.snc.process_flow.engine.FlowEventManager.processEvents(FlowEventManager.java:118)
com.glide.job.EventHandlerJob.execute(EventHandlerJob.java:37)
com.glide.schedule.JobExecutor.lambda$executeJob$0(JobExecutor.java:129)
com.snc.db.data_replicate.replicator.DataReplicationAdvisors.runInOriginatorContext(DataReplicationAdvisors.java:73)
com.glide.schedule.JobExecutor.lambda$inDataReplicationContext$2(JobExecutor.java:159)
com.glide.schedule.JobExecutor.executeJob(JobExecutor.java:132)
com.glide.schedule.JobExecutor.execute(JobExecutor.java:116)
com.glide.schedule_v2.SchedulerWorkerThread.executeJob(SchedulerWorkerThread.java:328)
com.glide.schedule_v2.SchedulerWorkerThread.lambda$process$0(SchedulerWorkerThread.java:210)
com.glide.worker.TransactionalWorkerThread.executeInTransaction(TransactionalWorkerThread.java:35)
com.glide.schedule_v2.SchedulerWorkerThread.process(SchedulerWorkerThread.java:210)
com.glide.schedule_v2.SchedulerWorkerThread.run(SchedulerWorkerThread.java:101)

 

And then:

Error serializing chunks for type ops and contextId: dfd130112bd60514fec8f7bd4c0afddf, error: Infinite recursion (StackOverflowError) (through reference chain: org.mozilla.javascript.BaseFunction["parentScope"]->com.glide.script.RhinoScope["SNString"]

But, it is a really long repeating error string...

com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:721)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:721)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:721)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:721)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:721)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)

Did a search on that error message, and it seems related to how output variables are defined.
KB0831630

Can you share the config of the subflow output definition?

Flow vars:

find_real_file.png

Sub-Flow Vars:

find_real_file.png

Sub-Flow I/O:

find_real_file.png

 

The assignment:

find_real_file.png

 

I originally had the simple 'checkbox' checked, but I swapped to javascript just to see if that changed anything.