{
  "name": "Pushyou · Deployment approval (dry run)",
  "nodes": [
    {
      "parameters": {},
      "id": "start",
      "name": "Manual trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "api",
              "name": "api_url",
              "value": "https://asia-northeast3-pushyou-prod.cloudfunctions.net/pushyouApi",
              "type": "string"
            },
            {
              "id": "room",
              "name": "conversation_id",
              "value": "YOUR_CONVERSATION_ID",
              "type": "string"
            },
            {
              "id": "id",
              "name": "request_id",
              "value": "deploy-staging-1_0_0",
              "type": "string"
            },
            {
              "id": "version",
              "name": "version",
              "value": "1.0.0",
              "type": "string"
            },
            {
              "id": "environment",
              "name": "environment",
              "value": "staging",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "config",
      "name": "Conversation and version",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $json.api_url + '/v1/conversations/' + encodeURIComponent($json.conversation_id) + '/tasks' }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ id: $json.request_id, title: 'Deployment approval · Dry run', body: 'Validate the version and environment. No deployment is executed.', category_id: 'operations', fields: [{ id: 'task_type', label: 'Task type', type: 'select', options: ['deploy_dry_run'], required: true }, { id: 'version', label: 'Version', type: 'text', required: true }, { id: 'environment', label: 'Environment', type: 'select', options: ['staging','production'], required: true }], inputs: { task_type: 'deploy_dry_run', version: $json.version, environment: $json.environment } }) }}",
        "options": {
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          },
          "timeout": 15000
        }
      },
      "id": "request",
      "name": "Pushyou approval request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        500,
        0
      ]
    }
  ],
  "connections": {
    "Manual trigger": {
      "main": [
        [
          {
            "node": "Conversation and version",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Conversation and version": {
      "main": [
        [
          {
            "node": "Pushyou approval request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "tags": []
}
