$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "blueprints": [
< {
< "blueprint": {
< "name": "Hourly Order Sync: HTTP to Iterator to Airtable",
< "version": 1,
< "metadata": {
< "instant": false,
< "version": 1,
< "scheduling": {
< "type": "indefinitely",
< "interval": 3600
< },
< "scenario": {
< "roundtrips": 1,
< "maxErrors": 3,
< "autoCommit": true
< }
< },
< "flow": [
< {
< "id": 1,
< "module": "http:ActionMakeRequest",
< "version": 3,
< "description": "Fetch Pending Orders Feed",
< "mapper": {
< "url": "https://orders.example.com/api/v1/pending",
< "method": "GET",
< "headers": [
< {
< "name": "Accept",
< "value": "application/json"
< }
< ],
< "parseResponse": true
< },
< "metadata": {
< "designer": {
< "x": 0,
< "y": 0
< }
< }
< },
< {
< "id": 2,
< "module": "builtin:BasicFeeder",
< "version": 1,
< "description": "Iterate Pending Order Items",
< "mapper": {
< "array": "{{1.data.items}}"
< },
< "metadata": {
< "designer": {
< "x": 300,
< "y": 0
< }
< }
< },
< {
< "id": 3,
< "module": "util:SetVariable2",
< "version": 1,
< "description": "Stamp Sync Date",
< "filter": {
< "name": "Only Active Orders",
< "conditions": [
< [
< {
< "a": "{{2.status}}",
< "o": "TEXT_EQUAL",
< "b": "active"
< }
< ]
< ]
< },
< "mapper": {
< "name": "syncedDate",
< "value": "{{formatDate(now; \"YYYY-MM-DD\")}}"
< },
< "metadata": {
< "designer": {
< "x": 600,
< "y": 0
< }
< }
< },
< {
< "id": 4,
< "module": "airtable:ActionCreateRecord",
< "version": 3,
< "description": "Create Airtable Order Record",
< "mapper": {
< "base": "appOrderBase001",
< "table": "Orders",
< "fields": {
< "ExternalId": "{{2.id}}",
< "CustomerName": "{{ifempty(2.name; \"Unknown\")}}",
< "SyncedOn": "{{3.syncedDate}}"
< }
< },
< "metadata": {
< "designer": {
< "x": 900,
< "y": 0
< }
< }
< },
< {
< "id": 5,
< "module": "builtin:BasicAggregator",
< "version": 1,
< "description": "Aggregate Created Airtable Records",
< "parameters": {
< "sourceModule": 2
< },
< "mapper": {
< "externalId": "{{2.id}}",
< "airtableId": "{{4.id}}"
< },
< "metadata": {
< "designer": {
< "x": 1200,
< "y": 0
< }
< }
< },
< {
< "id": 6,
< "module": "slack:ActionPostMessage",
< "version": 1,
< "description": "Post Hourly Batch Summary",
< "mapper": {
< "channel": "#ops-sync",
< "text": "Synced {{length(5.array)}} active orders to Airtable on {{formatDate(now; \"YYYY-MM-DD\")}}"
< },
< "metadata": {
< "designer": {
< "x": 1500,
< "y": 0
< }
< }
< }
< ]
< }
< }
< ],
< "monthlyRuns": 1000
<}
<EOF
$curl "https://api.apify.com/v2/actors/bodacious_mistral~make-to-cloudflare-analyzer/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'