I am setting up Salesforce OMS Order Orchestration and part of the requirement is to wait for Prescription Data before continue the Orchestration for that I've created a custom platform event OrderPrescribedEvent__e and OrderPrescribedTrigger is called when event is published. Flow goes like.
OrderSummary.Status = 'Waiting Prescription' means waiting for Platform Event
API Client auth is server-to-server and runs auth flow as a user with System Admin access
Platform Event API: OrderPrescribedEvent__e > OrderPrescribedTrigger > OrderSumStatusChangedEvent (NewStatus = 'Prescribed') > Flow is called after processing and changing OrderSummary.Status = 'Finding Pharmacy' Which fires OrderSumStatusChangedEvent
Find Pharmacy Flow is triggered due to OrderSumStatusChangedEvent and it makes a web callout or tries to make and break, with the following error
"Callout failed for invocable action FindPharmacyExternal.FindPharmacyCallout. We couldn't access the credential(s). You might not have the required permissions, or the external credential "XXXX" might not exist."
" How the Interview Started Platform Integration User (005Hp00000gjlDq) started the flow interview. "
enter image description here enter image description here
One of the problem is I have no idea which user is "005Hp00000gjlDq" it's not available under Users in Setup. I retried user from SOQL and I can see the user with no profile assigned but I am not sure how to give this user permissions or why is user is being used. For API token access i'm using which with System Admin profile so this is kind of puzzling.
However, everything is working fine if I change status of Order Summary from Order Management console to 'Finding Pharmacy' instead of above described flow.
I tried access 005Hp00000gjlDq user profile bu url rewriting in Setup but still no luck. Little confused over this solution