{
  "db_name": "PostgreSQL",
  "query": "WITH job_info AS (\n            -- Query for Teams (running jobs)\n            SELECT\n                parent_j.kind AS \"job_kind!: JobKind\",\n                parent_j.runnable_id AS \"script_hash: ScriptHash\",\n                parent_j.raw_flow AS \"raw_flow: sqlx::types::Json<Box<RawValue>>\",\n                child_j.parent_job AS \"parent_job: Uuid\",\n                parent_j.created_at AS \"created_at!: chrono::NaiveDateTime\",\n                parent_j.created_by AS \"created_by!\",\n                parent_j.runnable_path as script_path,\n                parent_j.args AS \"args: sqlx::types::Json<Box<RawValue>>\"\n            FROM v2_job_queue child_q JOIN v2_job child_j USING (id)\n            JOIN v2_job parent_j ON parent_j.id = child_j.parent_job\n            WHERE child_j.id = $1 AND child_j.workspace_id = $2\n            UNION ALL\n            -- Query for Slack (completed jobs)\n            SELECT\n                parent_j.kind AS \"job_kind!: JobKind\",\n                parent_j.runnable_id AS \"script_hash: ScriptHash\",\n                parent_j.raw_flow AS \"raw_flow: sqlx::types::Json<Box<RawValue>>\",\n                completed_j.parent_job AS \"parent_job: Uuid\",\n                completed_j.created_at AS \"created_at!: chrono::NaiveDateTime\",\n                completed_j.created_by AS \"created_by!\",\n                parent_j.runnable_path as script_path,\n                parent_j.args AS \"args: sqlx::types::Json<Box<RawValue>>\"\n            FROM v2_job_completed completed_c JOIN v2_job completed_j USING (id)\n            JOIN v2_job parent_j ON parent_j.id = completed_j.parent_job\n            WHERE completed_j.id = $1 AND completed_j.workspace_id = $2\n        )\n        SELECT * FROM job_info LIMIT 1",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "job_kind!: JobKind",
        "type_info": {
          "Custom": {
            "name": "job_kind",
            "kind": {
              "Enum": [
                "script",
                "preview",
                "flow",
                "dependencies",
                "flowpreview",
                "script_hub",
                "identity",
                "flowdependencies",
                "http",
                "graphql",
                "postgresql",
                "noop",
                "appdependencies",
                "deploymentcallback",
                "singlestepflow",
                "flowscript",
                "flownode",
                "appscript",
                "aiagent",
                "unassigned_script",
                "unassigned_flow",
                "unassigned_singlestepflow"
              ]
            }
          }
        }
      },
      {
        "ordinal": 1,
        "name": "script_hash: ScriptHash",
        "type_info": "Int8"
      },
      {
        "ordinal": 2,
        "name": "raw_flow: sqlx::types::Json<Box<RawValue>>",
        "type_info": "Jsonb"
      },
      {
        "ordinal": 3,
        "name": "parent_job: Uuid",
        "type_info": "Uuid"
      },
      {
        "ordinal": 4,
        "name": "created_at!: chrono::NaiveDateTime",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 5,
        "name": "created_by!",
        "type_info": "Varchar"
      },
      {
        "ordinal": 6,
        "name": "script_path",
        "type_info": "Varchar"
      },
      {
        "ordinal": 7,
        "name": "args: sqlx::types::Json<Box<RawValue>>",
        "type_info": "Jsonb"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid",
        "Text"
      ]
    },
    "nullable": [
      null,
      null,
      null,
      null,
      null,
      null,
      null,
      null
    ]
  },
  "hash": "fbd38c9c4f4ecba2d3e3d79433327fd4280466eec443aff4f1e8c1ab810cca7e"
}
