How to get detailed data of a workflow execution?

To display past executions (at least the ones which got saved to the database) the UI uses the endpoint /rest/executions/:id
Be however aware that this is not an officially supported API and is currently only meant for the Editor-UI. Meaning that it may change in the future. So if you rely on it, make sure to check what got changed before you upgrade to a new n8n version. The code for that endpoint can be found here:

The data of a currently running execution gets pushed to the Editor-UI via Server-Sent events. That happens via workflow hooks which get triggered at different points through the execution of the workflow. The code for that can be found here: