https://github.com/n8n-io/n8n/tree/master/packages/core/src/execution-engine
There are two ways to implement executions -
1. Simple executor that does everything in one go
2. Complex executor (queueing)