{
 "name": "Log Shopify orders to Google Sheets (AutomateRecipes)",
 "nodes": [
  {
   "parameters": {
    "topic": "orders/create",
    "authentication": "accessToken"
   },
   "id": "f51a7f61-4a96-59d7-a089-710ac3f6fd13",
   "name": "Shopify: order created",
   "type": "n8n-nodes-base.shopifyTrigger",
   "typeVersion": 1,
   "position": [
    0,
    0
   ],
   "credentials": {
    "shopifyAccessTokenApi": {
     "id": "",
     "name": "YOUR_SHOPIFYACCESSTOKENAPI_CREDENTIAL"
    }
   }
  },
  {
   "parameters": {
    "assignments": {
     "assignments": [
      {
       "id": "a",
       "name": "Date",
       "value": "={{ $json.created_at }}",
       "type": "string"
      },
      {
       "id": "b",
       "name": "Order",
       "value": "={{ $json.name }}",
       "type": "string"
      },
      {
       "id": "c",
       "name": "Total",
       "value": "={{ $json.total_price }}",
       "type": "string"
      },
      {
       "id": "d",
       "name": "Currency",
       "value": "={{ $json.currency }}",
       "type": "string"
      },
      {
       "id": "e",
       "name": "Customer",
       "value": "={{ ($json.customer?.first_name||'')+' '+($json.customer?.last_name||'') }}",
       "type": "string"
      },
      {
       "id": "f",
       "name": "Items",
       "value": "={{ ($json.line_items||[]).map(l=>l.quantity+'x '+l.title).join(', ') }}",
       "type": "string"
      }
     ]
    },
    "options": {}
   },
   "id": "a623062e-dae6-52fd-890c-e90a37929c62",
   "name": "Pick order fields",
   "type": "n8n-nodes-base.set",
   "typeVersion": 3.4,
   "position": [
    220,
    0
   ]
  },
  {
   "parameters": {
    "operation": "append",
    "documentId": {
     "__rl": true,
     "mode": "url",
     "value": "https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit"
    },
    "sheetName": {
     "__rl": true,
     "mode": "name",
     "value": "Orders"
    },
    "columns": {
     "mappingMode": "autoMapInputData",
     "value": {}
    },
    "options": {}
   },
   "id": "a39b2cfe-1138-5aab-b4f2-8bd38eddd702",
   "name": "Sheets: add order row",
   "type": "n8n-nodes-base.googleSheets",
   "typeVersion": 4.5,
   "position": [
    440,
    0
   ],
   "credentials": {
    "googleSheetsOAuth2Api": {
     "id": "",
     "name": "YOUR_GOOGLESHEETSOAUTH2API_CREDENTIAL"
    }
   }
  }
 ],
 "connections": {
  "Shopify: order created": {
   "main": [
    [
     {
      "node": "Pick order fields",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Pick order fields": {
   "main": [
    [
     {
      "node": "Sheets: add order row",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "executionOrder": "v1"
 },
 "active": false,
 "pinData": {},
 "meta": {
  "note": "Replace YOUR_* placeholders and attach your own credentials. Not tested on real services."
 }
}