Calculating Duration of Workflow

What is the best way to go about calculating the duration of your workflow? It doesn’t need to be exact, it could be one of the last nodes, if not the last node, but I’d like to be able to calculate this to be able to store to an external analytics tool.

Any help would be greatly appreciated

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 @workflowsy, you’d need to store the time before the node execution and calculate the difference after execution. Here’s a similar forum post that could help! Node n8n how Check run execution time? - #2 by MutedJam

1 Like

Hi @workflowsy

You can extract the executiontime of nodes from the executions table in the database. Also possible to get those via the API call where you extract the execution data. :slight_smile:

Like @aya Said you can also store the timestamps and calculate it that way, this is an awesome option if you want to see certain durations in a flow to keep track of things. Can also be combined with some data from the flow to generate a log of the execution. :slight_smile:

Hi Aya - I saw that solution, but thought there would be a better way to calculate using the n8n node and some sort of execution metadata but this should be fine!

hello @workflowsy

you can use the n8n API node and an Edit Fields node to calculate the duration

2 Likes

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