Workflow Automation
The Flow-Based Execution Model
A workflow in flow8 is called a “flow”—a connected sequence of steps, each called a “flowlet.” Think of flowlets as LEGO blocks: each one does one thing (extract PDF text, send an email, fetch a contact from CRM, wait for approval, split into parallel branches), and you snap them together to build a process.
When you run a flow, flow8 executes each flowlet in order (or in parallel, if you design it that way), passing data between them. The entire execution is logged and tracked, so you always know what happened, when, and why.
A Simple Example
Flow: Process expense reports
- Trigger: Expense report form submitted.
- Flowlet 1: Extract form data (name, amount, category, receipt image).
- Flowlet 2: Convert receipt image to PDF (if needed).
- Flowlet 3: Route to manager for approval (human decision point).
- Flowlet 4: If approved, create expense record in QuickBooks; if rejected, notify employee.
- Flowlet 5: Email confirmation to employee.
- Flowlet 6: Log the entire transaction for compliance.
Each execution of this flow is called a “play”—a complete run from start to finish. You can see every play’s history: inputs, outputs, errors, and how long each step took.
Trigger Types: How Flows Get Started
Flows run when triggered. flow8 supports multiple trigger mechanisms, so you can automate processes that happen unpredictably or on schedule.
Scheduled Triggers (Cron)
Run a flow on a recurring schedule:
- Every day at 9 AM: pull invoices from QuickBooks and reconcile them.
- Every Monday at 1 PM: send a weekly team report.
- Every month on the 1st: execute billing and renewal flows.
Use cron syntax for maximum flexibility, or pick from pre-built schedules (daily, weekly, monthly).
Manual Triggers
Run a flow on demand:
- A user clicks a button in flow8’s interface.
- Useful for tasks that happen irregularly but need to be trackable and consistent (e.g., “manually sync Salesforce now”).
API/Webhook Triggers
Trigger a flow from an external system or service:
- Customer submits a support request via your website → webhook fires → flow8 runs an intake flow.
- A new file appears in your Dropbox → Dropbox’s Zapier integration calls flow8’s API → flow8 starts a document processing flow.
- Your CRM sends a webhook when a deal is won → flow8 starts a fulfillment flow.
This is how you integrate flow8 into existing systems without them needing to know about each other.
Event-Based Triggers
Monitor for events and trigger flows:
- New email arrives in a specific mailbox → watch and trigger.
- New file uploaded to a shared folder → watch and trigger.
- New row added to a Google Sheet → watch and trigger.
Execution Flow: Sequential, Parallel, and Conditional
Sequential Execution
Most flows run step-by-step: flowlet A completes, passes its output to flowlet B, B completes and passes to C, and so on. This is the default and works for most processes.
Parallel Execution
Some flowlets can run simultaneously. Example:
- After extracting invoice data, simultaneously:
- Send to OCR (for scanning).
- Send to AI for classification.
- Check inventory via REST API.
- All three happen in parallel, then results are merged and passed to the next step.
Benefit: Faster execution. If sequential took 30 seconds (10 sec + 10 sec + 10 sec), parallel takes ~10 seconds (all happening at once).
Conditional Branches (Router Flowlet)
Decide what to do based on data:
- If invoice amount > $5,000, send to manager approval.
- If amount ≤ $5,000, approve automatically.
- If vendor is on a block list, reject.
The Router flowlet evaluates conditions and branches the flow to different paths. Each branch is a separate sequence of flowlets, and they rejoin at the end.
Loops (Iterator Flowlet)
Process lists of items:
- You have 50 customer records to sync to Salesforce.
- Iterator loops through each record and runs the sync flowlet 50 times.
- Each iteration gets one record and outputs the result.
- After the loop, you have 50 results combined.
Use case: Batch processing, bulk imports, one-to-many operations.
Approval Gates: Keeping Humans in the Loop
Automation isn’t about removing humans—it’s about removing drudgery so humans can focus on decisions that matter.
The NeedsApproval flowlet is how you inject human decision-making into a flow:
- Flow reaches a NeedsApproval step (e.g., after calculating recommended action).
- Flow pauses and sends a notification (email, Slack, SMS) to the approver(s).
- Approver reviews the decision context (data, recommendation, reasoning) and approves or rejects.
- Flow resumes: if approved, continues to the next step; if rejected, runs a different branch or halts.
Example: Vendor contract approval
- New contract arrives.
- AI analyzes it for risk (unfavorable payment terms, missing clauses, conflict with existing contracts).
- Flow pauses at NeedsApproval and notifies Legal.
- Legal reviews AI’s assessment, approves (“looks good”) or rejects (“needs negotiation”).
- If approved, Flow automatically signs and files. If rejected, routes to negotiation workflow.
The benefit: Mundane decisions (approvals that are always “yes”) are automated. High-judgment decisions (does this contract look safe?) get human eyes, but with AI research already done.
Multi-Level Approval
Flows can chain multiple approval steps:
- Manager approves a $5K purchase (delegated authority).
- CFO approves a $50K purchase (higher authority).
- CEO approves a $500K purchase (executive authority).
Each level is a NeedsApproval flowlet. The flow pauses at each one.
Error Handling and Retry
Things go wrong: APIs time out, data is malformed, a service is temporarily down. flow8 handles these gracefully.
Built-In Retry Logic
Configure how many times to retry a failed step:
- Retry up to 3 times with 30-second delays.
- Or: exponential backoff (wait longer between each retry).
- Or: give up immediately and trigger an error handler.
Example: Try to post to Slack. If it fails (network blip), retry 2 more times. If all 3 attempts fail, log the error and send an alert to ops.
Error Handlers
When a flowlet fails, you can:
- Branch to an error recovery flowlet (try an alternative approach).
- Log the error with context (what input caused the failure?).
- Send an alert (email, Slack, SMS) to your team.
- Pause the flow and wait for manual intervention.
- Fail the entire flow and mark it as requiring review.
Example: Try to fetch a customer from Salesforce. If not found, create them. If creation fails, send an error alert and pause.
Timeouts
Set maximum execution time for a flowlet or entire flow:
- If a step takes longer than 5 minutes, timeout and branch to an error handler.
- Useful for integrations that sometimes hang.
Execution History and Traceability
Every time a flow runs, flow8 creates a “play” record. Each play contains:
- Input data — what triggered the flow and what parameters were passed.
- Step-by-step execution log — which flowlets ran, in what order, duration of each.
- Output data — results from each flowlet, including any errors.
- State transitions — how the flow progressed (running → waiting for approval → completed).
- Timestamp — exactly when everything happened.
- User info — who triggered it (if manual) or which system triggered it (if automated).
Why This Matters
Debugging: If a flow fails, you can see exactly which step broke and why. Was the API call malformed? Did the data not match expectations? You have the evidence.
Compliance: Regulators ask “can you prove that this process was followed?” flow8 says “yes—here’s the complete audit trail.” No guessing, no reconstructing.
Optimization: See which steps are slow. Maybe step 3 always takes 30 seconds; could you optimize it? flow8 gives you the data.
Customer Service: If a customer asks “what happened to my order?”, trace the entire flow execution and explain each step.
Real-Time Monitoring
As flows execute, flow8 provides real-time visibility via:
- WebSocket streaming — see flow progress live in a dashboard.
- Slack notifications — get alerts when flows complete, fail, or reach approval gates.
- Email summaries — daily digest of all flow executions, including failures.
- Flow execution dashboard — view all active, completed, and failed plays with full details.
Dashboard View
- List of all flows, with status (active/paused/disabled).
- For each flow, see recent play executions (last 10 runs).
- For each play, see total duration, success/failure, step-by-step breakdown.
- Search and filter plays by date, status, or flowlet name.
- Drill into a failed play to see error details and retry options.
Data Passing Between Flowlets
Flowlets pass data using a key-value structure. Output from one flowlet becomes the input to the next.
Example
- Flowlet 1 (ExtractPDF): Reads a PDF, outputs
{ text: "...", pages: 15, file_name: "contract.pdf" }. - Flowlet 2 (AIClassify): Takes that output, uses the
textfield, outputs{ classification: "vendor_contract", risk_level: "medium" }. - Flowlet 3 (SendToLegal): Takes both outputs, formats a message, sends to Legal team via email.
Each flowlet documents what inputs it expects and what outputs it produces. flow8 validates data as it flows through, so mismatches are caught early.
State Storage (KV Store)
For data that needs to persist across multiple flow executions, use flow8’s key-value store:
- Global scope: accessible to all flows in your organization.
- Flow scope: accessible only to this specific flow across all its executions.
- Execution scope: temporary, cleared after the flow completes.
Example: Track “total invoices processed this month.”
- Flowlet 1: reads the current count from the KV store, increments it, saves it back.
- Flowlet 2: uses that count in a report.
- Next month, the count resets.
Performance and Scalability
flow8 is built to handle volume:
- Flows execute independently; 1,000 flows running simultaneously don’t block each other.
- Retry logic, parallel execution, and async processing keep things moving.
- Typical execution of a 5-step flow takes 5–30 seconds, depending on external API latencies.
Async Flows
Some steps take a long time (generate a 100-page PDF, train an ML model, sync 10,000 records). Use async/queue mechanisms:
- Flowlet adds a task to a queue, immediately continues.
- Background worker processes the queue, completes the task, notifies the flow.
- Flow continues without waiting.
Benefit: Your flow doesn’t block. Other flows run. Users don’t wait.
Building Flows Without Code
You don’t write code to build a flow. Instead:
- Open flow8’s visual flow builder.
- Drag flowlets onto the canvas.
- Connect them with lines (output of A connects to input of B).
- Configure each flowlet (what email to send? which fields to extract?).
- Save and run.
If you want to use JavaScript for transformations, flow8 supports it (e.g., “take these 3 fields and combine them into one formatted string”), but it’s optional and encapsulated—not the entire flow.
Example: Email-to-Task Automation
Trigger: Daily at 9 AM, check an email inbox.
- Email Poller: Check for new emails marked as “Action Needed.”
- Router: For each email:
- If subject contains “URGENT,” go to urgent branch.
- Otherwise, go to standard branch.
- Extract Data (Urgent): Parse email, pull sender, subject, body.
- AI Summarize: Use Claude to create a 1-line summary of the email.
- Create Task (Urgent): Create a high-priority task in your project management tool with the summary.
- Send Slack Alert: Post to #urgent-tasks channel.
- Extract Data (Standard): Parse email similarly.
- AI Summarize: Create summary.
- Create Task (Standard): Create normal-priority task.
- Email Batch: Email a daily digest of all tasks to the team.
- Log: Record all emails processed for compliance.
Result: Every morning, your team opens their task manager and urgent/standard emails are already there as tasks, with AI-generated summaries. Zero manual work.
Summary: Reliability, Transparency, Control
flow8’s automation engine gives you:
- Reliability: Triggers work consistently; errors are handled; retries are automatic.
- Transparency: Every execution is logged and auditable; you see exactly what happened.
- Control: You can pause flows, approve decisions, adjust configurations; humans stay in charge.
- Scalability: Processes the same way whether handling 10 items or 10,000.
This is the foundation for automating any repetitive, multi-step business process.