{
  "schema_version": "1.0",
  "name": "Tutorial demo \u00b7 API research to Sheets",
  "nodes": [
    {
      "id": "start",
      "type": "nudge",
      "position": {
        "x": 0,
        "y": 100
      },
      "data": {
        "label": "Start the API demo",
        "kind": "trigger.manual",
        "eyebrow": "manual",
        "icon": "globe",
        "tone": "teal",
        "config": {}
      }
    },
    {
      "id": "fetch",
      "type": "nudge",
      "position": {
        "x": 310,
        "y": 100
      },
      "data": {
        "label": "Fetch a demo company",
        "kind": "action.http",
        "eyebrow": "http",
        "icon": "globe",
        "tone": "teal",
        "config": {
          "method": "GET",
          "url": "https://jsonplaceholder.typicode.com/users/1",
          "headers": [
            {
              "id": "Accept",
              "key": "Accept",
              "value": "application/json",
              "enabled": true
            }
          ],
          "params": [],
          "bodyMode": "none",
          "authMode": "none",
          "timeout": 30,
          "followRedirects": true,
          "ignoreHttpErrors": false
        }
      }
    },
    {
      "id": "select",
      "type": "nudge",
      "position": {
        "x": 620,
        "y": 100
      },
      "data": {
        "label": "Reference the response",
        "kind": "action.code",
        "eyebrow": "code",
        "icon": "globe",
        "tone": "teal",
        "config": {
          "language": "expression",
          "expression": "{{steps.fetch.body}}"
        }
      }
    },
    {
      "id": "filter",
      "type": "nudge",
      "position": {
        "x": 930,
        "y": 100
      },
      "data": {
        "label": "Require an email",
        "kind": "logic.filter",
        "eyebrow": "filter",
        "icon": "filter",
        "tone": "teal",
        "config": {
          "combinator": "all",
          "rules": [
            {
              "left": "{{steps.select.result.email}}",
              "operator": "is_not_empty",
              "right": ""
            }
          ]
        }
      }
    },
    {
      "id": "route",
      "type": "nudge",
      "position": {
        "x": 0,
        "y": 390
      },
      "data": {
        "label": "Does it have a website?",
        "kind": "logic.condition",
        "eyebrow": "condition",
        "icon": "branch",
        "tone": "teal",
        "config": {
          "combinator": "all",
          "rules": [
            {
              "left": "{{steps.fetch.body.website}}",
              "operator": "is_not_empty",
              "right": ""
            }
          ],
          "true_label": "Ready",
          "false_label": "Review"
        }
      }
    },
    {
      "id": "map",
      "type": "nudge",
      "position": {
        "x": 310,
        "y": 390
      },
      "data": {
        "label": "Prepare a research row",
        "kind": "action.transform",
        "eyebrow": "transform",
        "icon": "globe",
        "tone": "teal",
        "config": {
          "fields": [
            {
              "id": "title",
              "key": "title",
              "value": "{{steps.fetch.body.company.name}}",
              "enabled": true
            },
            {
              "id": "url",
              "key": "url",
              "value": "https://{{steps.fetch.body.website}}",
              "enabled": true
            },
            {
              "id": "source",
              "key": "source",
              "value": "Public demo API",
              "enabled": true
            }
          ]
        }
      }
    },
    {
      "id": "pause",
      "type": "nudge",
      "position": {
        "x": 620,
        "y": 390
      },
      "data": {
        "label": "Pause for one second",
        "kind": "logic.delay",
        "eyebrow": "delay",
        "icon": "clock",
        "tone": "teal",
        "config": {
          "amount": 1,
          "unit": "seconds"
        }
      }
    },
    {
      "id": "save",
      "type": "nudge",
      "position": {
        "x": 930,
        "y": 390
      },
      "data": {
        "label": "Write the research row",
        "kind": "action.sheets",
        "eyebrow": "sheets",
        "icon": "table",
        "tone": "teal",
        "config": {
          "credential_id": "",
          "spreadsheet_id": "",
          "worksheet": "Research",
          "mode": "append",
          "values": [
            {
              "id": "title",
              "key": "title",
              "value": "{{steps.map.title}}",
              "enabled": true
            },
            {
              "id": "url",
              "key": "url",
              "value": "{{steps.map.url}}",
              "enabled": true
            },
            {
              "id": "source",
              "key": "source",
              "value": "{{steps.map.source}}",
              "enabled": true
            }
          ]
        }
      }
    }
  ],
  "edges": [
    {
      "id": "a0",
      "source": "start",
      "target": "fetch"
    },
    {
      "id": "a1",
      "source": "fetch",
      "target": "select"
    },
    {
      "id": "a2",
      "source": "select",
      "target": "filter"
    },
    {
      "id": "a3",
      "source": "filter",
      "target": "route"
    },
    {
      "id": "a4",
      "source": "route",
      "target": "map",
      "label": "Ready"
    },
    {
      "id": "a5",
      "source": "map",
      "target": "pause"
    },
    {
      "id": "a6",
      "source": "pause",
      "target": "save"
    }
  ],
  "settings": {}
}
