Quick Start
Get started with Floww in under 5 minutes. Build your first workflow and deploy it to production.
Create a New Project
Use the floww init command to create a new project:
This will:
- Create a new project directory
- Set up the necessary files (
main.ts, package.json, etc.)
- Install dependencies automatically
Then navigate to your project:
cd my-workflow # or whatever name you chose
Your First Workflow
Edit the main.ts file created by floww init:
main.ts
import { Builtin } from "floww";
const builtin = new Builtin();
builtin.triggers.onCron({
expression: "*/1 * * * * *",
handler: (ctx, event) => {
console.log("Do this every second", event.scheduledTime);
},
});
Run in Development
Start the development server:
What happens:
- Your triggers are registered on the Floww server
- Events are routed to your local machine for execution
- Your code hot-reloads when you make changes
- Logs appear in your terminal in real-time
You should see a new log line every second as the cron trigger fires.
Try a Webhook
Let's add a webhook trigger to handle HTTP requests. Update your main.ts:
main.ts
import { Builtin } from "floww";
const builtin = new Builtin();
// Cron trigger - runs every second
builtin.triggers.onCron({
expression: "*/1 * * * * *",
handler: (ctx, event) => {
console.log("Cron triggered at", event.scheduledTime);
},
});
// Webhook trigger - responds to HTTP requests
builtin.triggers.onWebhook({
path: "/hello",
handler: (ctx, event) => {
console.log("Webhook received:", event.body);
return {
message: "Hello from Floww!",
timestamp: new Date().toISOString()
};
},
});
When you run floww dev, you'll get a webhook URL like:
✓ Webhook registered: https://api.usefloww.dev/webhook/w_abc123/hello
Test it with curl:
curl -X POST https://api.usefloww.dev/webhook/w_abc123/hello \
-H "Content-Type: application/json" \
-d '{"name": "World"}'
Deploy to Production
When you're ready to deploy:
What happens:
- Your TypeScript code is bundled
- Code is uploaded to Floww cloud
- Infrastructure is provisioned automatically
- You receive production webhook URLs
Your workflow will now run in the cloud, handling events 24/7.