0

This question already has an answer here:

I have SharePoint list. I have added Event receivers on SharePoint list for ItemAdded event.

Also I have SharePoint designer workflow on same list which triggers on Item created and Item Updated.

I would like to know which actually gets trigger first. Event Receiver or Workflow?

Please explain reason. also I would like to know if I have ItemUpdated event receiver and Designer workflow for trigger when item get updated.

marked as duplicate by Aakash Maurya, Robert Lindgren, Gautam Sheth, Karthik Jaganathan, Mohamed El-Qassas MVP Jun 28 '17 at 12:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Answer by Chris O'Brien - MVP for Execution order of event receivers and workflow on a list

If a list has workflows defined which are set to auto-start, these will always execute before any other 'ItemUpdated' or 'ItemCreated' event receivers by default. It is possible to re-order these in code however - I needed to do this once as for some reason I needed a receiver to fire before the workflow did it's processing. To re-order, simply get the SPList.EventReceivers and modify the Sequence property of each one you want to change (and call .Update()).

Remember though, that if someone disables workflow and then configures it again (with auto-start), SharePoint will add the SPWorkflowAutostartEventReceiver back in as Sequence=1, meaning the re-ordering would need to happen again.

Not the answer you're looking for? Browse other questions tagged or ask your own question.