You need to sign in to do that
Don't have an account?
Emily Phillips
Apex CPU time limit exceeded in Production but not sandbox
I have a scheduled flow that uses an apex action to use a simple invocable method. I'm simply passing the record Id from the flow to the apex class and deleting permission set assignments. The scheduled flow and class are able to process 300 records in a full copy sandbox environment but running into Apex CPU time limit exceeded in Production for about 100 records.
Why is the same flow and class running into this error in production but not sandbox?
Why is the same flow and class running into this error in production but not sandbox?
It depends on various factors like number of records, execution time taken. Best would be check debug logs and see which components is taken more time. You can figure out which code is consuming more time using analysis perspective in developer console log inspector.
https://help.salesforce.com/s/articleView?id=000387833&type=1
https://www.salesforceben.com/what-is-apex-cpu-time-limit-exceeded-how-do-you-solve-it/
Please mark as Best Answer if above information was helpful.
Thanks,
I understand, however it might not be issue only with flow but also with dependent component that might invoke when flow is executed, the only way to fix CPU limit error is checking logs and narrow down the scenerio and refactor login in component if it is taking too to execute. Kindly recheck if there are any other batch or component is being executig parallely.
Hope this helps...
Thanks,