Article #000001338
Question
Why is my file not being uploaded to SharePoint?
Summary
When multiple platform event messages are published in quick succession by different users simultaneously, and if those messages are subscribed by a flow in bulk, at times, the flow cannot handle the messages and runs into error scenarios.
Details of Issue
This issue is caused by the following Salesforce platform known issue:
Subscriber Flow unable to handle multiple simultaneous platform event messages from different users
The Upload Document flow runs into this issue only when multiple workspaces are attached to a record. For example, the Acme account record has four workspaces linked to it (because of the four opportunities related to the Acme account).
The known issue is triggered because platform events auto-combine the execution of the uploaded document into a single execution thread (ideally, the document as we upload from our code is uploaded in the individual thread of execution, so four workspaces means we upload a document to SharePoint in four separate threads. It is important to understand that within Flows, Salesforce carries out its own optimization sequence to improve performance, and thus, it auto-combines the execution of the four document uploads into a single execution. So, the execution runs into a governor limit in the platform, where a platform event cannot be executed after an external API (like uploading a document to SharePoint) is executed.
- The platform Governor Limits simply follows two rules:
- One platform event execution can trigger multiple external API executions without issues.
- No platform event can be executed after external API executions.
- When multiple workspaces are linked to an Account, the upload document flow will execute one platform event for each document uploaded. Each platform event execution is supposed to be asynchronous, and the above rules should apply without causing any errors.
- Due to this underlying bug, all Platform Events are now combined into a single execution (thus, they are not asynchronous).
Resolution/Workaround
There is no workaround for this issue yet.