Your First Flow
This guide walks through creating a complete integration flow with transforms, conditions, error handling, and self-healing configuration.
The scenario
Section titled “The scenario”You need to sync new Shopify orders to SAP Business One. When a paid order comes in, you want to:
- Transform the Shopify order data to SAP format
- Check if the customer exists in SAP — if not, create them
- Create the sales order in SAP
- Handle errors gracefully
Generate the initial flow
Section titled “Generate the initial flow”Start with a natural language prompt:
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.
Flow anatomy
Section titled “Flow anatomy”Trigger
Section titled “Trigger”Every flow starts with a trigger — the event that kicks off the integration:
name: shopify-to-sap-ordersdescription: 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.
Transform step
Section titled “Transform step”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_numberConditional step
Section titled “Conditional step”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 }}"Delivery step
Section titled “Delivery step”Create the sales order in SAP:
- deliver: connector: sap-b1 action: sales_order.createSelf-healing config
Section titled “Self-healing config”Tell fyrn how to handle API changes:
healing: auto_fix: true confidence_threshold: 0.95 notify_on_fix: trueFixes above 95% confidence are applied automatically. Below that, they’re routed for human review.
Test the flow
Section titled “Test the flow”Before deploying, run a dry test:
# Validate the configfyrn validate flows/shopify-to-sap-orders.yaml
# Dry run with sample datafyrn test --dry-run --flow shopify-to-sap-orders
# Test with live connectors (staging)fyrn test --env staging --flow shopify-to-sap-ordersDeploy
Section titled “Deploy”fyrn deploy --env productionMonitor
Section titled “Monitor”# Real-time statusfyrn status shopify-to-sap-orders
# View recent messagesfyrn logs shopify-to-sap-orders --tail
# Check healthfyrn health shopify-to-sap-ordersVersion and iterate
Section titled “Version and iterate”The flow is a YAML file in your repo. Use Git to version it:
git add flows/shopify-to-sap-orders.yamlgit commit -m "feat: add Shopify → SAP order sync"git pushWhen you need to change the flow, edit the YAML (or run fyrn generate with updated instructions), review the diff, and deploy.
Next steps
Section titled “Next steps”- Architecture — How the runtime executes flows
- Self-Healing — Deep dive on drift detection and auto-fix
- DSL Reference — Full YAML DSL specification