{
  "trigger": {
    "type": "lead_status",
    "pipeline_id": 100001,
    "status_id": 200000
  },
  "start": "take_lead_task",
  "nodes": {
    "take_lead_task": {
      "type": "task",
      "config": {
        "text": "Взять заявку в работу",
        "deadline_minutes": 15,
        "task_type_id": 1,
        "result_set_code": "take_lead",
        "results": [
          {
            "code": "taken",
            "name": "Взял в работу",
            "sort_order": 10,
            "next": "working_status"
          },
          {
            "code": "not_target",
            "name": "Не целевой",
            "sort_order": 20,
            "next": "not_target_note"
          }
        ]
      }
    },
    "working_status": {
      "type": "status",
      "config": {
        "pipeline_id": 100001,
        "status_id": 200001
      },
      "next": "working_note"
    },
    "working_note": {
      "type": "note",
      "config": {
        "text": "Заявка взята в работу процессом Routena."
      },
      "next": "success_end"
    },
    "not_target_note": {
      "type": "note",
      "config": {
        "text": "Заявка отмечена как нецелевая."
      },
      "next": "not_target_field"
    },
    "not_target_field": {
      "type": "field",
      "config": {
        "field_id": 300001,
        "value": "Не целевой"
      },
      "next": "not_target_end"
    },
    "success_end": {
      "type": "end",
      "config": {}
    },
    "not_target_end": {
      "type": "end",
      "config": {}
    }
  }
}
