n8n node
Run code in any of 46 languages from an n8n workflow, judge it against test cases for a verdict and a score, or let n8n's AI Agent run the code it writes. Each run happens in a fresh sandbox with no network, not inside your n8n instance.
The node is verified by n8n. In the nodes panel, search for OnlineCompiler.io and add it to your workflow. On a self-hosted n8n you can also install it under Settings, Community nodes, Install with the package name n8n-nodes-onlinecompiler. It is listed on n8n's
integrations page and on npm.
Get a free API key from the dashboard (key type API), then create an OnlineCompiler.io API credential in n8n and paste the key.
What it does
- Run Code: runs a program with optional standard input and returns its output, errors, status, exit code, time and memory.
- Run Tests: runs the program once per test case and returns an overall verdict, a score from 0 to 100, how many passed and a verdict for each test. Output can be compared as trim, exact, tokens, float, rows, table or table ordered; the score is a percent or all or nothing.
- List Compilers: returns every language with the compiler id to use, such as
python-3.14org++-15, one item per language; they are also on the languages page.
Every field takes an expression, so the code and input can come from a form, a webhook, a sheet or an earlier node:
Operation: Run Code
Language: C++ (g++ 15) (ID g++-15)
Code: {{ $json.code }}
Input: {{ $json.input }}The next node gets:
{
"output": "5\n",
"error": "",
"status": "success",
"exit_code": 0,
"time": "0.0021",
"memory": "3584"
}Run Tests sends on:
{
"verdict": "accepted",
"score": 100,
"passed": 2,
"total": 2,
"tests": [ ... ]
}What people build with it
- Grade submissions: a form or an LMS webhook sends a student's code, Run Tests scores it against the exercise's test cases, and the score goes back to a sheet or the LMS.
- An AI agent that checks its own code: add the node as a tool to the AI Agent; the agent runs the program it wrote and reads the result before answering. See code execution for AI agents.
- Run code from chat or email: a Telegram, Slack or email trigger passes the code in, and the reply carries the output.
Each run gets up to 30 seconds and 512 MB (up to 2 GB on Pro and above), with no network. More ideas, each with code to copy: 10 things you can build.
Source and issues: github.com/onlinecompiler-io/n8n-nodes-onlinecompiler. The same checks are available over the run-tests API.
Questions
- Why not use n8n's Code node?
- n8n's Code node runs JavaScript and Python inside your n8n instance. This node runs 46 languages, among them C, C++, Java, Go, Rust, SQL and R, each in a fresh sandbox with no network, so it suits code you didn't write: student submissions, code from a form or webhook, or code an AI agent wrote.
- Is it free?
- Yes, with a free API key: the Free plan has 100,000 runs a month, commercial use included, and needs no card. Each test in Run Tests counts as one run.
- Can the AI Agent use it?
- Yes. The node can be added as a tool to n8n's AI Agent, so the agent can run the code it writes, read the output or the error, and fix the code before it answers.
- Where is the API key kept?
- In an OnlineCompiler.io API credential, which n8n stores encrypted with its other credentials, not in the workflow, so exporting or sharing a workflow does not share the key.