{
  "workflow_name": "When order completed in WooCommerce, create invoice in Zoho Invoice and email to customer automatically",
  "workflow_steps": {
    "steps": [
      {
        "id": "1",
        "position": {
          "x": 0,
          "y": 0
        },
        "data": {
          "label": "Order Status Set to Completed",
          "app": {
            "key": "woocommerce",
            "fm_app": "woocommerce"
          },
          "eventSlug": "order_status_completed",
          "eventTitle": "Order Status Set to Completed",
          "layoutDirection": "horizontal",
          "stepNumber": 1
        },
        "targetPosition": "bottom",
        "type": "trigger",
        "stepNumber": 1,
        "expanded": true,
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "application": "woocommerce",
        "stepID": "1",
        "action": "order_status_completed",
        "nodeType": "step",
        "actionAppArgs": []
      },
      {
        "id": "2",
        "position": {
          "x": 175,
          "y": 0
        },
        "type": "action",
        "data": {
          "label": "Create the Zoho customer",
          "layoutDirection": "horizontal",
          "stepNumber": 2,
          "app": {
            "key": "zoho_invoice",
            "fm_app": "zoho_invoice"
          },
          "eventSlug": "create_customer",
          "eventTitle": "Create Customer"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "contact_name": "{woocommerce1.billing_first_name} {woocommerce1.billing_last_name} (order {woocommerce1.order_number})",
          "first_name": "{woocommerce1.billing_first_name}",
          "last_name": "{woocommerce1.billing_last_name}",
          "email": "{woocommerce1.billing_email}"
        },
        "application": "zoho_invoice",
        "action": "create_customer",
        "nodeType": "step",
        "stepID": "2"
      },
      {
        "id": "3",
        "position": {
          "x": 350,
          "y": 0
        },
        "type": "action",
        "data": {
          "label": "Create invoice",
          "layoutDirection": "horizontal",
          "stepNumber": 3,
          "app": {
            "key": "zoho_invoice",
            "fm_app": "zoho_invoice"
          },
          "eventSlug": "create_invoice",
          "eventTitle": "Create Invoice"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "customer_id": "{zoho_invoice2.contact_id}",
          "_li_name": "Order {woocommerce1.order_number}",
          "_li_quantity": "1",
          "_li_rate": "{woocommerce1.total}"
        },
        "application": "zoho_invoice",
        "action": "create_invoice",
        "nodeType": "step",
        "stepID": "3"
      },
      {
        "id": "4",
        "position": {
          "x": 525,
          "y": 0
        },
        "type": "action",
        "data": {
          "label": "Email invoice to customer",
          "layoutDirection": "horizontal",
          "stepNumber": 4,
          "app": {
            "key": "zoho_invoice",
            "fm_app": "zoho_invoice"
          },
          "eventSlug": "email_invoice",
          "eventTitle": "Email Invoice"
        },
        "parentType": "step",
        "style": {
          "transition": "all 150ms ease-in-out"
        },
        "measured": {
          "width": 82,
          "height": 82
        },
        "actionAppArgs": {
          "invoice_id": "{zoho_invoice3.invoice_id}",
          "to": "{woocommerce1.billing_email}"
        },
        "application": "zoho_invoice",
        "action": "email_invoice",
        "nodeType": "step",
        "stepID": "4"
      },
      {
        "id": "main_end_placeholder",
        "position": {
          "x": 700,
          "y": 0
        },
        "type": "placeholder",
        "data": {
          "label": "+",
          "layoutDirection": "horizontal",
          "stepNumber": null,
          "app": []
        },
        "measured": {
          "width": 40,
          "height": 82
        },
        "stepID": "main_end_placeholder",
        "nodeType": "placeholder",
        "actionAppArgs": []
      }
    ],
    "edges": [
      {
        "id": "e-1-2",
        "source": "1",
        "target": "2",
        "type": "step",
        "data": []
      },
      {
        "id": "e-2-3",
        "source": "2",
        "target": "3",
        "type": "step",
        "data": []
      },
      {
        "id": "e-3-4",
        "source": "3",
        "target": "4",
        "type": "step",
        "data": []
      },
      {
        "id": "e-4-main_end_placeholder",
        "source": "4",
        "target": "main_end_placeholder",
        "type": "placeholder",
        "data": []
      }
    ]
  },
  "workflow_settings": {
    "name": "When order completed in WooCommerce, create invoice in Zoho Invoice and email to customer automatically",
    "folder": "all",
    "description": "When a WooCommerce order is completed, FlowMattic creates a Zoho Invoice customer from the billing details, creates an invoice for the order total, and emails it to the customer. The customer name includes the order number so repeat buyers never clash in Zoho.",
    "status": "off",
    "user_email": "",
    "webhook_queue": "disabled",
    "workflow_auth_key": "",
    "builder_version": "v2",
    "time": "",
    "ai_generated": "yes"
  }
}