# Tutorial: Listing running workflow exections with API

**URL:** <https://community.n8n.io/t/tutorial-listing-running-workflow-exections-with-api/172501>\
**Category:** Tips & Tricks\
**Tags:** core, node, n8n-node\
**Created:** [August 20, 2025, 3:21pm UTC](https://community.n8n.io/t/tutorial-listing-running-workflow-exections-with-api/172501 "2025-08-20T15:21:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikgudi](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/erikgudi/32/111800_2.png) [@erikgudi](https://community.n8n.io/u/erikgudi)\
**Post date:** [August 20, 2025, 3:21pm UTC](https://community.n8n.io/t/tutorial-listing-running-workflow-exections-with-api/172501/1 "2025-08-20T15:21:16Z")

</div>

# How to list **running executions** from _inside_ a workflow (Self-Hosted n8n)

I’ve seen a bunch of threads asking how to see **currently running** executions on self-hosted n8n. This is not possible via the official n8n API, but I made it work with the internal REST endpoints.

It’s just three nodes: **Login → Grab cookie → Get executions**.

> Example URLs below use `http://localhost:5678`. It should work directly with this url. But you can swap it with your base URL.

* * *

## 1) HTTP Request — **Login**

This hits the n8n login endpoint and gives us a session cookie.

- **Method:** `POST`

- **URL:** `http://localhost:5678/rest/login`

- **Authentication:** None

- **Send body as JSON:**

- **Options → Response:**

This returns a `Set-Cookie` header containing the JWT session (commonly the `n8n-auth` cookie).

* * *

## 2) Code — **Grab cookie**

Extract the session cookie from the Login node’s headers so we can reuse it.

```auto
// Name this node "Grab Cookie". Assumes the Login node is named "Login".
const headers = $node["Login"].json.headers || {};
const raw = headers['set-cookie'] || headers['Set-Cookie'] || [];
const list = Array.isArray(raw) ? raw : [raw];

// Keep only the "name=value" part; find the n8n auth cookie.
const cookie = list
  .map(s => String(s).split(';')[0].trim())
  .find(s => s.startsWith('n8n-auth='));

if (!cookie) {
  throw new Error('Auth cookie not found in /rest/login response');
}

return [{ json: { cookie } }];

```

> Tip: If your Login node is named differently, update `$node["Login"]` accordingly.

* * *

## 3) HTTP Request — **Get executions**

Now call the internal executions endpoint using the cookie.

- **Method:** `GET`

- **URL:** `http://localhost:5678/rest/executions`

- **Authentication:** None

- **Headers:**

- **Options → Response:**

This endpoint returns **finished and running** executions (the same live data the Editor shows). The public `/api/v1/executions` doesn’t expose the “running” list in the same way, which is why this internal endpoint is handy.

* * *

## (Optional) Show only “running”

Right after step 3, add either:

**IF node**

- Condition: `{{$json.status}}` **equals** `running`

_or_

**Code node**

```auto
// When "Split Into Items" is ON in step 3, each item is one execution.
if ($json.status === 'running') {
  return [{ json: $json }];
}
return [];

```

* * *

## What you get

Each item is an execution object (e.g., `id`, `workflowId`, `status`, timestamps, etc.). Use it to:

- Build a tiny Webhook that returns only currently running executions

- Alert when your workflow is already running

- Create your own dashboard inside n8n

* * *

## Notes

- These `/rest/*` endpoints are **internal** to the Editor app and may change between versions. Keep the three-node block isolated so it’s easy to update later.

- If you’re not on `localhost`, make sure your reverse proxy forwards cookies correctly (no stripping/rewriting).

That’s it—three nodes and you’ve got a reliable list of running executions directly from your self-hosted n8n. If you want, I can share a minimal importable workflow that wires these exact nodes together.
