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

if you set as system , then it will run as system . 

I understand that.  But what I don't understand that if it is running as system why it would get errors due to security constraints, and the only way to fix is to adjust ACLs to allow the user who initiated to be able to create?

I have just noticed that although in the operation view of the subflow it says executed as 'system'. the task is showing as created by 'user who initiated', where as the earlier parts of my flow the tasks are correctly showing as created by system.  It just seems that the subflow is somehow holding the old value for the run as.

might be possible in cache it has stored . 

surya123
Mega Guru

Hi,

Figured out, just delete the subflow and readd again in flow. Somehow the changes dont show unless it is added again,

 

Thanks

Surya