Flow Designer - Create Task Action getting Error

Sam Ogden
Tera Guru

Hi All,

I've created a flow that calls several subflows.  This executes on insert of a record in a custom application.  We are getting end users to create the record on the portal via a record producer.  The first few steps are executing as expected, but when it gets to the 5th step a create task action is giving an error when an end user create the request - the create task function is in a subflow, but the subflow is set to run as system.

If I fill in the record producer in as an admin the create task action is working as expected.  Also if I test the flow it works as expected.  

The record producer creates a record in work request table.  The flow then creates several work tasks.  The flow fails at point 5 when trying to create a work task.  The flow has already created 2 tasks in this table.  The error in the context shows as prohibited by security rules.  Any idea why the flow would have created 2 records in the table and fail on this one?

Any help as to why it would not work for an end user, when the subflow is set to run as system.  

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Kaleb4
Tera Expert

@samogden YES!!! Thank you for responding back with the results of your HI Case! That was the exact problem I was having and changing the run as property for the sub flow, and then deactivating and reactivating the main flow fixed my issue.

Quoting what @samogden said in a reply.

"Hi Surya, I eventually got this working after raising a HI ticket. The issue was I initially had set the sunflower to run as user who initiates and had published both the flow and sub flow. Although I changed the property on the sub flow to run as system, and made a few other changes and re-published the sub flow it was not working. It turned out that when you publish the main flow it builds the flow execution record. Making the change to the sub flow was not properly updating this record so although in the flow context it appeared to be running as system in truth it wasn’t. I needed to deactivate the main flow that calls the sub flow and make a small change such as adjusting an annotation then save the main flow and re publish it. This apparently rebuilds the execution record correctly. Let me know if this helps in your instance and mark as helpful or correct if so. Thanks Sam"

 

Hopefully you can mark this as solved so others can find this post.

 

Thanks!

View solution in original post

16 REPLIES 16

did you check the "Create" operation ACL  on that table ? 

I've not changed that yet, but the flow is has already created 2 tasks on that table in earlier steps (all flows and subflows set to run as system).

I don't get therefore why I would need to change the create ACL if it has already created 2 tasks in the table?

I've ameded the create ACL and it is now working, but I don't understand why the previous 2 tasks were both working without having this amendment in place.

not exactly sure,

the first time it has executed ,what exactly have you selected in run as "system" or "user who initiate the session" ?

When I first created the subflow I had accidently saved and published as to execute as 'user who initiate the session'. 

I then realised the error after the flow had executed.  So I changed the execution to be run as 'system'.

When it runs, it says it has run as system, but then I've been hitting these errors.  It almost seems like it is saying it is running as system but is in fact still running as user who initiated?