You want to take a small piece of code, throw it on the internet, and call it from anywhere. You write a file, you push it, you get a URL back. This guide walks through it on FlowEngine Functions, end to end, with real screenshots from the portal.
Skill level: beginner to intermediate. Time required: about 5 minutes for your first function. You'll need a free FlowEngine account and either a local terminal or just a browser.
What You'll Build
A live HTTPS endpoint that returns "hello world" with the caller's IP and a timestamp. Once it works, you'll know how to swap the body for anything else: a webhook handler, a Slack bot, an LLM proxy, a scheduled report.
Before You Start
- A FlowEngine account. Sign up at flowengine.cloud, free, no credit card.
- Node.js 20 installed locally if you want to use the CLI path. The portal path needs nothing.
- A text editor. Anything works.
Step 1: Open the Functions Page
From the portal sidebar, click Functions. You land on the function list. If you've never deployed one before, the page is empty with a single New Function button in the top right.
Step 2: Pick a Starting Point
Click New Function. The modal shows a handful of ways to start: copy the CLI command, copy the MCP config, write code in the browser, start from a template, deploy from GitHub, or upload a folder. For a first function, "Write code in the browser" is the fastest.
Step 3: Pick a Runtime
FlowEngine Functions supports two runtimes today:
- Node.js 20 for JavaScript and TypeScript
- Python 3.11 for Python
Pick Node.js 20 for this walkthrough. The starter code drops in automatically.
Step 4: Write the Handler
The starter exports a request handler. The signature is the standard Node HTTP handler, so you get a req and res just like you'd expect.
// index.js
export default async (req, res) => {
res.json({
message: 'hello world',
ip: req.headers['x-forwarded-for'] || req.socket.remoteAddress,
at: new Date().toISOString(),
});
};
Add a package.json so FlowEngine knows you're shipping ESM:
{
"name": "hello",
"type": "module"
}
That's the whole function.
Step 5: Deploy
Two options, pick one.
Portal path. Paste both files into the inline editor in the New Function modal. Give the function a name (lowercase, hyphens), pick memory (512 MiB is fine), set the timeout (15 seconds is the default), click Deploy. The function appears in the list with a status badge that goes from deploying to ready. About 30 seconds.
CLI path. Drop the two files into a folder. Install the CLI:
npm i -g @flowengine.cloud/flowengine-cli
fe login
fe deploy
The CLI prompts for a function name on first deploy, then bundles, uploads, and prints the live URL.
Step 6: Call It
Copy the URL from the function detail page (or from the CLI output) and curl it:
curl https://your-function-name.fn.flowengine.cloud
You should get JSON back with your IP and a timestamp. That's a live serverless endpoint.
Step 7: Add a Secret (Optional)
Most real functions need an API key. FlowEngine has workspace-level secrets you set once and reference from any function.
Open the function detail page, click Secrets, add a key like OPENAI_API_KEY. The next deploy will pick it up. In code, read it with process.env.OPENAI_API_KEY.
If you reference an env var in your code that you haven't set yet, FlowEngine surfaces it in the portal so you know what's missing. No more "why is this returning 500" when the secret didn't propagate.
Step 8: Watch the Logs
The Logs tab on the function detail page shows every request: status code, latency, and any console.log output, with the most recent at the top. The logs stream live, so you can curl your function in one tab and watch the entry land in the other.
Common Mistakes
- Missing
"type": "module"in package.json. Yourexport defaultwon't resolve. Add the field. - Timeout too short. If your function calls a slow API, bump the timeout on Pro or Teams (free tier caps at 15 seconds).
- Forgot to set a secret. The deploy will succeed but requests return 500. Check the function's environment checklist in the portal.
- Cold starts on free tier. The free tier sets min instances to zero, so the first call after a quiet period takes a second longer. Upgrade to Pro to keep a warm pool.
Going Further
Once your hello-world is live, the same pattern handles anything: replace the body with a Stripe webhook verifier, an LLM call, a scraper, a database write. The endpoint, the secrets, the logs all work the same way.
For automations that involve more than one step, FlowEngine also runs hosted n8n alongside Functions. n8n is the right tool when you want to wire together five APIs visually. Functions is the right tool when you want to write 30 lines of code and forget about it.
Wrapping Up
You took a script, gave it a URL, and watched it run. That's the whole job of a serverless function. Everything else is variations on the theme: more memory, longer timeouts, a cron trigger, a Slack event.
Try FlowEngine free and ship your first function in under five minutes.
