{
  "name": "Post a dashboard screenshot to Slack",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "30 7 * * 1-5"
            }
          ]
        }
      },
      "id": "schedule",
      "name": "Weekday mornings",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// The sign in runs as commands before the shot is taken.\n// Keep the credentials in n8n credentials, never as literal text here.\nreturn [{ json: {\n  url: 'https://dashboard.internal.example.com/overview',\n  commands: [\n    { type: 'type',  selector: 'input[name=email]',    value: $env.DASHBOARD_USER },\n    { type: 'type',  selector: 'input[name=password]', value: $env.DASHBOARD_PASS },\n    { type: 'click', selector: 'button[type=submit]' },\n    { type: 'click', selector: \"[data-range='last-7-days']\" },\n  ],\n} }];"
      },
      "id": "capture-request",
      "name": "Capture request",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://e.customjs.io/REPLACE_WITH_YOUR_FUNCTION_ID",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.CUSTOMJS_API_KEY }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "id": "capture",
      "name": "Capture with sign in",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ]
    }
  ],
  "connections": {
    "Weekday mornings": {
      "main": [
        [
          {
            "node": "Capture request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Capture request": {
      "main": [
        [
          {
            "node": "Capture with sign in",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}
