Skip to content

Your First Flow

This guide walks through creating a complete integration flow with transforms, conditions, error handling, and self-healing configuration.

You need to sync new Shopify orders to SAP Business One. When a paid order comes in, you want to:

  1. Transform the Shopify order data to SAP format
  2. Check if the customer exists in SAP — if not, create them
  3. Create the sales order in SAP
  4. Handle errors gracefully

Start with a natural language prompt:

Terminal window
fyrn generate "When a paid order is created in Shopify, transform it to SAP format, \
ensure the customer exists in SAP (create if not), and create a sales order"

fyrn generates a complete YAML config. Let’s review it section by section.

Every flow starts with a trigger — the event that kicks off the integration:

flows/shopify-to-sap-orders.yaml
name: shopify-to-sap-orders
description: Sync paid Shopify orders to SAP Business One
trigger:
connector: shopify
event: order.created
filter: "{{ trigger.financial_status == 'paid' }}"

The filter ensures only paid orders are processed. fyrn uses Jinja-style template expressions.

Map Shopify fields to SAP fields:

steps:
- transform:
map:
order_id: "{{ trigger.id }}"
customer_email: "{{ trigger.customer.email }}"
customer_name: "{{ trigger.customer.first_name }} {{ trigger.customer.last_name }}"
total: "{{ trigger.total_price }}"
currency: "{{ trigger.currency }}"
line_items: "{{ trigger.line_items | map('sku', 'quantity', 'price') }}"
validate:
- field: customer_email
rule: email
- field: total
rule: positive_number

Check if the customer exists and create them if needed:

- condition:
if: "{{ not customer_exists(trigger.customer.email) }}"
then:
- deliver:
connector: sap-b1
action: business_partner.create
map:
name: "{{ steps.transform.customer_name }}"
email: "{{ steps.transform.customer_email }}"

Create the sales order in SAP:

- deliver:
connector: sap-b1
action: sales_order.create

Tell fyrn how to handle API changes:

healing:
auto_fix: true
confidence_threshold: 0.95
notify_on_fix: true

Fixes above 95% confidence are applied automatically. Below that, they’re routed for human review.

Before deploying, run a dry test:

Terminal window
# Validate the config
fyrn validate flows/shopify-to-sap-orders.yaml
# Dry run with sample data
fyrn test --dry-run --flow shopify-to-sap-orders
# Test with live connectors (staging)
fyrn test --env staging --flow shopify-to-sap-orders
Terminal window
fyrn deploy --env production
Terminal window
# Real-time status
fyrn status shopify-to-sap-orders
# View recent messages
fyrn logs shopify-to-sap-orders --tail
# Check health
fyrn health shopify-to-sap-orders

The flow is a YAML file in your repo. Use Git to version it:

Terminal window
git add flows/shopify-to-sap-orders.yaml
git commit -m "feat: add Shopify → SAP order sync"
git push

When you need to change the flow, edit the YAML (or run fyrn generate with updated instructions), review the diff, and deploy.