Response sample of using API to retrieve details of a run

Hey, we’re exploring n8n for our needs and one of the things we’d like to do is offer our users

According to the API documentation (API reference | n8n Docs), we can pass -includeData to the GET call to get an execution’s details.

Is this available to all users (hosted version) or only on the enterprise plan?
Would it be possible to post a response sample with details?

Thanks in advance

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @JanVanderHaegen, welcome to the community!

The REST API is available in all editions, so it can also be used by users of our free community edition or the non-enterprise plans on n8n cloud.

That said, I am currently getting an unexpected error when testing this API endpoint on my own instance. I’ve asked our engineering team for a closer look and will get back to you as soon as I hear back.

Thank you for the welcome and your reply!

You’re most welcome. Turns out, the unexpected error is caused by my specific workflow, the API is working fine in principle.

Here’s a quick example of how the execution data looks like:

{
	"id": "4949",
	"finished": true,
	"mode": "manual",
	"retryOf": null,
	"retrySuccessId": null,
	"status": "success",
	"startedAt": "2023-12-12T15:32:22.597Z",
	"stoppedAt": "2023-12-12T15:32:22.810Z",
	"deletedAt": null,
	"workflowId": "kJMFFhFfEhsYN3Uj",
	"waitTill": null,
	"data": {
		"startData": {
			"destinationNode": "OpenWeatherMap",
			"runNodeFilter": [
				"When clicking \"Execute Workflow\"",
				"OpenWeatherMap"
			]
		},
		"resultData": {
			"runData": {
				"When clicking \"Execute Workflow\"": [
					{
						"startTime": 1702395142685,
						"executionTime": 0,
						"source": [],
						"executionStatus": "success",
						"data": {
							"main": [
								[
									{
										"json": {},
										"pairedItem": {
											"item": 0
										}
									}
								]
							]
						}
					}
				],
				"OpenWeatherMap": [
					{
						"startTime": 1702395142686,
						"executionTime": 124,
						"source": [
							{
								"previousNode": "When clicking \"Execute Workflow\""
							}
						],
						"executionStatus": "success",
						"data": {
							"main": [
								[
									{
										"json": {
											"coord": {
												"lon": 13.5871,
												"lat": 52.6798
											},
											"weather": [
												{
													"id": 804,
													"main": "Clouds",
													"description": "overcast clouds",
													"icon": "04n"
												}
											],
											"base": "stations",
											"main": {
												"temp": 6.73,
												"feels_like": 6.73,
												"temp_min": 4.7,
												"temp_max": 8.25,
												"pressure": 1035,
												"humidity": 72
											},
											"visibility": 10000,
											"wind": {
												"speed": 1.28,
												"deg": 113,
												"gust": 1.43
											},
											"clouds": {
												"all": 99
											},
											"dt": 1702394947,
											"sys": {
												"type": 2,
												"id": 2038554,
												"country": "DE",
												"sunrise": 1702364872,
												"sunset": 1702392640
											},
											"timezone": 3600,
											"id": 2950096,
											"name": "Bernau bei Berlin",
											"cod": 200
										},
										"pairedItem": {
											"item": 0
										}
									}
								]
							]
						}
					}
				]
			},
			"pinData": {},
			"lastNodeExecuted": "OpenWeatherMap"
		},
		"executionData": {
			"contextData": {},
			"nodeExecutionStack": [],
			"metadata": {},
			"waitingExecution": {},
			"waitingExecutionSource": {}
		}
	},
	"workflowData": {
		"id": "kJMFFhFfEhsYN3Uj",
		"name": "Example workflow with execution data",
		"active": false,
		"nodes": [
			{
				"parameters": {
					"notice": ""
				},
				"id": "9fe35202-d48d-4184-90b7-0236cef82012",
				"name": "When clicking \"Execute Workflow\"",
				"type": "n8n-nodes-base.manualTrigger",
				"typeVersion": 1,
				"position": [
					820,
					340
				]
			},
			{
				"parameters": {
					"operation": "currentWeather",
					"format": "metric",
					"locationSelection": "cityName",
					"cityName": "bernau bei berlin, de",
					"language": "en"
				},
				"id": "765ebdb7-7d11-476a-b2ac-efcdad4c2f0a",
				"name": "OpenWeatherMap",
				"type": "n8n-nodes-base.openWeatherMap",
				"typeVersion": 1,
				"position": [
					1040,
					340
				],
				"credentials": {
					"openWeatherMapApi": {
						"id": "77",
						"name": "OpenWeatherMap account"
					}
				}
			}
		],
		"connections": {
			"When clicking \"Execute Workflow\"": {
				"main": [
					[
						{
							"node": "OpenWeatherMap",
							"type": "main",
							"index": 0
						}
					]
				]
			}
		},
		"settings": {
			"executionOrder": "v1",
			"saveManualExecutions": true,
			"callerPolicy": "workflowsFromSameOwner"
		},
		"pinData": {}
	}
}

This is for a simple workflow fetching the current weather:

Of course it will also work for much more complex workflows, but the example would get much harder to read. That’s why I simply retrieved the current weather here.

Hope this helps! Let me know if you have any questions on the example above.

2 Likes

That is brilliant and much more than we had hoped for. Thank you so much

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.