Example Use Cases

Webhook → Slack Notification

import { Builtin, Slack } from "floww";

const builtin = new Builtin();
const slack = new Slack();

builtin.triggers.onWebhook({
  path: "/deploy",
  handler: async (ctx, event) => {
    await slack.postMessage({
      channel: "#deployments",
      text: `🚀 Deployment triggered for ${event.body.project}`
    });
  }
});

Daily Report with Cron

import { Builtin } from "floww";

const builtin = new Builtin();

builtin.triggers.onCron({
  expression: "0 9 * * 1-5",  // Weekdays at 9 AM
  handler: async (ctx, event) => {
    const stats = await fetchDailyStats();
    await sendReportEmail(stats);
  }
});

GitLab → AI Analysis

import { Gitlab, OpenAI } from "floww";
import { generateText } from "floww/ai";

const gitlab = new Gitlab();
const openai = new OpenAI();

gitlab.triggers.onMergeRequestEvent({
  handler: async (ctx, event) => {
    const { title, description } = event.object_attributes;

    const analysis = await generateText({
      model: openai.models.gpt4,
      prompt: `Analyze this merge request: ${title}\n${description}`
    });

    console.log("AI Analysis:", analysis.text);
  }
});

When you use providers like slack, gitlab, or openai for the first time, Floww will automatically prompt you to configure them.