Skip to main content
The Functions layer of Pharen Hub is built around the idea that every repeating process in your business deserves to be automated, audited, and continuously improving. Workflows are the engine of that layer: visual, configurable sequences of steps that connect people, data, AI agents, and external systems. Whether you’re routing invoices for approval, onboarding a new customer, or responding to a support escalation, workflows eliminate the manual coordination that slows teams down and creates errors.

Core Concepts

Before building your first workflow, it helps to understand how the main pieces fit together.

Triggers

Every workflow starts with a trigger: a specific event that causes it to begin. Triggers can be a new list record, an incoming email, a schedule, a manual action, or a step in another workflow.

Steps

Steps are the actions the workflow takes: updating a record, sending a notification, requesting an approval, running an agent, calling an external API, or branching based on a condition.

Conditions

Conditions let a workflow branch. Based on field values, approval decisions, or agent outputs, the workflow can follow different paths for different situations.

Audit Trail

Every workflow run is logged. You can see exactly which steps ran, what data passed through them, who took which action, and when — for every single execution.

Building an Approval Workflow

The most common workflow pattern in Pharen Hub is the approval loop: a record is created, routed to one or more reviewers, and approved or rejected — with each decision logged and the process continuing automatically.
1

Open Workflows

Navigate to Functions → Workflows in the left sidebar and click + New Workflow.
2

Name your workflow

Give the workflow a clear, process-oriented name like invoice-approval or contract-review. This name is used when triggering the workflow from agents, App Builder apps, and code.
3

Set the trigger

Click + Add Trigger and choose the event that starts this workflow. For an invoice approval, choose List record updated and configure it to fire when an invoice record’s status changes to Pending Approval.
4

Add an approval step

Click + Add Step → Approval. Configure:
  • Assignee: The person, role, or dynamic expression (e.g., the Manager field on the record) that receives the approval request.
  • Context: Attach the relevant doc, list record, or file so the approver has everything they need.
  • Deadline: An optional time limit. If the deadline passes with no action, the workflow can auto-escalate or auto-reject.
  • Delivery: Send the approval request as a Hub notification, a channel message, an email, or all three.
5

Branch on the decision

After the approval step, add a Condition branching on the decision result:
  • Approved: Continue to the next step (e.g., update the record status to Approved, post to a channel, trigger an ERP transfer).
  • Rejected: Route back to the originator with a rejection reason, update the record status to Returned, and optionally notify the submitter by email.
6

Add post-approval steps

Add steps for what happens after approval: update the record, send a confirmation email, post a channel message, or call an external API. Use the HTTP Request step to push data to your ERP, CRM, or any external system.
7

Test and activate

Click Test Workflow to run it against a real or synthetic record in sandbox mode. Review the execution log, adjust any steps, then click Activate to go live.
Build approval workflows incrementally. Start with a single-step approval, activate it, and observe a few live runs before adding escalation logic and multi-step branching. Iterating on a working workflow is faster than designing a perfect one from scratch.

Automation Triggers

Workflows can be started by a wide range of events. Choose the right trigger for your process:
TriggerDescription
Record createdFires when a new record is added to a list
Record updatedFires when any field (or a specific field) changes value
Status changed toFires when the Status field reaches a specific value
Record dueFires a set time before or after a Date field
Record assignedFires when the Assignee field is set or changed

Workflow Steps Reference

Request a human decision. Configure the assignee, context, deadline, and delivery channels. The workflow pauses until the approver acts. Returns approved or rejected and an optional comment.
Write new values to fields in any list record. Use dynamic expressions to pull values from the trigger payload or from previous steps — e.g., set Approved By to the identity of the approver from the previous step.
Send a Hub notification, a channel message, or an email. Supports templated messages using {{field_name}} placeholders that are filled at runtime from the record or workflow context.
Invoke a named AI agent as a workflow step. Pass the current record as context. The agent executes its task and returns a result that subsequent steps can use. For example: run the invoice-processor agent to validate an invoice before routing it for approval.
Make a GET, POST, PUT, or PATCH request to any external URL. Use this to push approved data to your ERP, call a payment API, update a CRM record, or integrate with any third-party system that exposes an API.
Branch the workflow based on any field value, approval decision, agent output, or HTTP response. Each branch continues independently and can rejoin at a later merge step if needed.
Pause the workflow for a set duration or until a specific datetime. Useful for reminder sequences: send a notification, wait 48 hours, and if no action has been taken, escalate.
Create a new record in any list. Useful for spawning sub-tasks, logging summaries, or creating output records from a workflow run.

Audit Trails

Every workflow execution generates a complete, immutable audit trail. This is not optional logging — it’s a first-class feature of Hub’s Functions layer.

What’s Logged

For every workflow run, Hub records:
  • The trigger event and its full payload
  • Each step that executed, in order
  • The input and output data for each step
  • The identity and timestamp of every human action (approval, rejection, manual trigger)
  • Any errors or retries, with the error details
  • The final outcome of the run

Accessing the Audit Trail

1

Open Workflows

Navigate to Functions → Workflows and select the workflow you want to inspect.
2

Open Run History

Click the Run History tab. You’ll see a list of every execution, sorted by most recent, with status (Completed, Failed, Pending, Cancelled) and duration.
3

Inspect a run

Click any run to open the execution detail view. Each step is shown as a timeline entry. Click a step to see its input, output, and timing. Approval steps show who acted and when.
4

Export the log

Click Export to download the full run log as JSON. This is useful for compliance reporting or feeding into external audit systems.
Audit trail data is retained for the lifetime of your workspace. If your compliance requirements demand a specific retention period or external archival, use the Export function or the Audit API to pull logs to your own storage.

Notifications and Escalations

Workflows communicate with people through notifications. Hub gives you fine-grained control over how and when those messages are sent.

Notification Channels

Each notification step can deliver to one or more channels simultaneously:
  • Hub notification — appears in the recipient’s in-app notification bell
  • Channel message — posts to a named channel, optionally with an @mention
  • Email — sends to the recipient’s connected email address
  • Mobile push — sends a push notification to the Hub mobile app

Escalation Patterns

Set a deadline on any approval step. If the deadline passes without action:
  1. The workflow checks the escalation rule.
  2. It reassigns the approval to the escalation target (e.g., the approver’s manager).
  3. It sends a new notification with context about the missed deadline.
  4. It logs the escalation in the audit trail.
Configure deadline and escalation under the Approval Step → Advanced settings.
Use a Wait step followed by a Condition step to build reminder sequences:
  1. Send the initial approval request.
  2. Wait 24 hours.
  3. Check: has the record’s Approval Status changed?
  4. If not, send a reminder notification.
  5. Wait another 24 hours.
  6. If still pending, escalate.

Real-World Use Cases

Invoice Processing

Manual invoice handling is one of the highest-friction processes in most organizations. Hub reduces it from ~15 minutes per invoice to ~2 minutes.
1

Receive

An invoice arrives by email at invoices@yourcompany.com. The inbound mail trigger fires.
2

Extract

The invoice-processor AI agent uses OCR to extract vendor, amount, line items, due date, and PO number from the attached PDF — in under 60 seconds.
3

Create record

The agent creates a record in the Invoice list with all extracted fields populated and sets the status to Pending Approval.
4

Route

The invoice-approval workflow triggers. Based on the amount, it routes to the appropriate approver tier (under €5,000 → team lead, €5,000–€50,000 → finance manager, above €50,000 → CFO).
5

Approve

The approver receives a notification with the full invoice context and a one-click approve button — accessible from web or mobile.
6

Transfer

On approval, the workflow calls the ERP HTTP endpoint to create the payment order automatically. The record status updates to Transferred and the audit trail closes.

Insurance Claims Triage

Hub’s AI triage cuts claim capture and initial review time dramatically.
  • A new claim arrives (email, form, or direct API post).
  • The AI agent reads submitted documents in under 1 minute, extracting claim type, claimant, amount, and supporting evidence quality.
  • Claims are scored for urgency and completeness and sorted into a prioritized queue.
  • Adjusters work the queue in order — no manual sorting, no missed claims.
  • Each step is logged for regulatory audit purposes.
For regulated industries, enable the Immutable Audit Log option under Workspace Settings → Compliance. This writes all workflow events to a write-once log that cannot be edited or deleted, suitable for regulatory review.