{
  "name": "Daily building permit leads to Google Sheets (HTTP fallback)",
  "flow": [
    {
      "id": 1,
      "module": "http:MakeRequest",
      "version": 4,
      "parameters": {
        "tlsType": "",
        "authenticationType": "noAuth"
      },
      "mapper": {
        "url": "https://api.apify.com/v2/acts/loomwise~city-building-permits/run-sync-get-dataset-items?format=json&clean=true&limit=1000",
        "method": "post",
        "headers": [
          {
            "name": "Authorization",
            "value": "Bearer REPLACE_WITH_YOUR_APIFY_TOKEN"
          },
          {
            "name": "Content-Type",
            "value": "application/json"
          }
        ],
        "inputMethod": "jsonString",
        "shareCookies": false,
        "parseResponse": true,
        "allowRedirects": true,
        "stopOnHttpError": true,
        "jsonStringBodyContent": "{\n  \"cities\": [\n    \"dallas_tx\",\n    \"austin\",\n    \"seattle\"\n  ],\n  \"workCategories\": [\n    \"Roofing\",\n    \"Solar\",\n    \"Mechanical / HVAC\"\n  ],\n  \"issuedWithinDays\": 7,\n  \"maxResults\": 100,\n  \"onlyWithContractor\": true\n}",
        "requestCompressedContent": true,
        "timeout": "300"
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0
        },
        "restore": {
          "expect": {
            "method": {
              "mode": "chose",
              "label": "POST"
            },
            "inputMethod": {
              "label": "JSON string"
            }
          },
          "parameters": {
            "authenticationType": {
              "label": "No authentication"
            }
          }
        },
        "label": "Run Actor sync + get dataset items",
        "note": "HTTP v4 Make a request. Paste your Apify API token into Authorization (keep 'Bearer '). Response array is in data."
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": {
        "array": "{{1.data}}"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0
        },
        "restore": {
          "extra": {
            "item": {
              "mode": "chose"
            }
          }
        },
        "label": "Iterate dataset items",
        "note": "Built-in Iterator. One cycle per dataset item."
      }
    },
    {
      "id": 3,
      "module": "google-sheets:addRow",
      "version": 2,
      "parameters": {
        "__IMTCONN__": "REPLACE_GOOGLE_CONNECTION"
      },
      "mapper": {
        "spreadsheetId": "REPLACE_WITH_YOUR_GOOGLE_SHEET_ID",
        "sheetId": "Sheet1",
        "values": {
          "issuedDate": "{{2.issuedDate}}",
          "city": "{{2.city}}",
          "permitNumber": "{{2.permitNumber}}",
          "workCategory": "{{2.workCategory}}",
          "valuation": "{{2.valuation}}",
          "address": "{{2.address}}",
          "contractorBusinessName": "{{2.contractorBusinessName}}",
          "description": "{{2.description}}",
          "permitUrl": "{{2.permitUrl}}"
        },
        "includesHeaders": true
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0
        },
        "parameters": [
          {
            "name": "__IMTCONN__",
            "type": "account:google",
            "label": "Connection",
            "required": true
          }
        ]
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false
    },
    "designer": {
      "orphans": []
    },
    "notes": [
      "HTTP fallback that avoids the native Apify Get Dataset Items module.",
      "Uses http:MakeRequest v4 \u2192 builtin:BasicFeeder \u2192 google-sheets:addRow.",
      "Replace REPLACE_WITH_YOUR_APIFY_TOKEN (keep Bearer prefix) and reconnect Google Sheets.",
      "Scheduling is outside the blueprint \u2014 set via the scenario clock after import.",
      "Sync endpoint times out around 300s; for longer runs use Apify schedules + webhooks instead."
    ]
  }
}
