{
  "workflowCode": "HOL01_READYDESK_REQUEST",
  "name": "HOL01 ReadyDesk Request",
  "description": "Original fictional equipment-request training workflow. No business writes, orders or messages.",
  "specification": {
    "jsonSchemaName": "Workflow.spec",
    "jsonSchemaVersion": "1",
    "inputs": [],
    "outputSpecification": " ",
    "agentsValueMappings": [],
    "dataPipeline": {
      "pipelineNodes": [
        {
          "id": "a0b12a96-6e5c-5c9d-b5c8-cbc5b636fe5c",
          "code": "START",
          "type": "START",
          "metadata": {
            "name": "Start",
            "description": "Start of data pipeline"
          },
          "outcomes": {
            "success": "6d619381-d53b-5663-b3e5-2f505ffa2806"
          },
          "inputs": [],
          "diagram": {
            "x": 5000,
            "y": 5230
          }
        },
        {
          "id": "6d619381-d53b-5663-b3e5-2f505ffa2806",
          "code": "INTERPRET_REQUEST",
          "type": "LLM",
          "metadata": {
            "description": "Extract fictional equipment request fields without approving or ordering.",
            "name": "Interpret Request",
            "errorNodeId": "d5ada406-5bfb-5dff-99d6-8f669b51a926"
          },
          "diagram": {
            "x": 5206,
            "y": 5222
          },
          "outcomes": {
            "success": "52eda8f5-ab33-50bb-8187-e8e618848ef3"
          },
          "inputs": [
            {
              "id": "50d224c7-3dc0-580a-b8c5-ea64bdc258be",
              "name": "systemPrompt",
              "type": "string",
              "value": "You interpret fictional ReadyDesk requests. Return only the agreed JSON. Extract requestId from the supplied Request RD-... prefix. Classify the task before checking the item: use equipment_request for requests for any equipment, including an unsupported item such as a printer; validation checks the allowed item list separately. Use unsupported for unrelated tasks such as cancelling an order, or unclear for an ambiguous task. Preserve an unsupported item by name. Normalize plurals to singular. Missing or invalid quantities are null; never infer quantity 1 from a plural without a number. Preserve an explicit whole number, including zero, for later validation. missingFields lists absent requestId, item or quantity. Do not approve, order, reserve stock, send messages or invent values."
            },
            {
              "id": "a53f0710-c916-5efa-a917-24c4863e74c8",
              "name": "prompt",
              "type": "string",
              "value": "{{$context.$system.$inputMessage}} "
            }
          ],
          "outputSpecification": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"requestId\": {\n      \"type\": [\n        \"string\",\n        \"null\"\n      ]\n    },\n    \"intent\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"equipment_request\",\n        \"unsupported\",\n        \"unclear\"\n      ]\n    },\n    \"item\": {\n      \"type\": [\n        \"string\",\n        \"null\"\n      ]\n    },\n    \"quantity\": {\n      \"type\": [\n        \"integer\",\n        \"null\"\n      ]\n    },\n    \"missingFields\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    }\n  },\n  \"required\": [\n    \"requestId\",\n    \"intent\",\n    \"item\",\n    \"quantity\",\n    \"missingFields\"\n  ],\n  \"additionalProperties\": false\n}"
        },
        {
          "id": "52eda8f5-ab33-50bb-8187-e8e618848ef3",
          "code": "VALIDATE_REQUEST",
          "type": "CODE",
          "metadata": {
            "name": "Validate Request",
            "returnType": "object",
            "sourceCode": "'use strict';\n/* ReadyDesk training rules. Fictional data; no business writes. */\nfunction validateRequest(input) {\n  if (!input || typeof input !== 'object' || Array.isArray(input)) {\n    return {status: 'needs_clarification', reason: 'Provide the request fields.'};\n  }\n  if (input.intent === 'unsupported') return {status: 'unsupported', reason: 'This desk handles equipment requests only.'};\n  if (input.intent !== 'equipment_request') return {status: 'needs_clarification', reason: 'Clarify the requested task.'};\n  const requestId = typeof input.requestId === 'string' ? input.requestId.trim() : '';\n  const item = typeof input.item === 'string' ? input.item.trim().toLowerCase() : '';\n  if (item && !['laptop', 'monitor'].includes(item)) {\n    return {status: 'unsupported', reason: 'This desk handles laptop and monitor requests only.'};\n  }\n  if (!requestId || !item) {\n    return {status: 'needs_clarification', reason: 'Provide a request ID and supported item.'};\n  }\n  const raw = input.quantity;\n  // Reject blanks, booleans, trailing text and fractional notation rather than guessing.\n  const validType = typeof raw === 'number' || (typeof raw === 'string' && /^\\d+$/.test(raw.trim()));\n  const quantity = validType ? Number(raw) : NaN;\n  if (!Number.isInteger(quantity) || quantity < 1 || quantity > 10) {\n    return {status: 'needs_clarification', reason: 'Provide a whole-number quantity from 1 to 10.'};\n  }\n  return {status: 'ready', requestId, item, quantity, nextStep: 'Review the request; no order has been placed.'};\n}\n\nreturn validateRequest($context.$nodes.INTERPRET_REQUEST.$output);\n",
            "errorNodeId": "d5ada406-5bfb-5dff-99d6-8f669b51a926"
          },
          "diagram": {
            "x": 5656,
            "y": 5222
          },
          "outcomes": {
            "success": "45a66a67-da1f-57e5-84ea-d8aa1ad9c92d"
          },
          "inputs": [],
          "outputSpecification": "{\n  \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"result\": {\n      \"type\": \"object\"\n    },\n    \"timeout\": {\n      \"type\": \"boolean\"\n    },\n    \"error\": {\n      \"type\": \"string\"\n    }\n  },\n  \"additionalProperties\": false,\n  \"required\": [\n    \"result\",\n    \"timeout\",\n    \"error\"\n  ]\n}"
        },
        {
          "id": "45a66a67-da1f-57e5-84ea-d8aa1ad9c92d",
          "code": "ROUTE_REQUEST",
          "type": "SWITCH",
          "convergenceTargetId": "f609b7c3-bf02-5289-814b-0fc49e398c2c",
          "metadata": {
            "name": "Route Request",
            "errorNodeId": "d5ada406-5bfb-5dff-99d6-8f669b51a926"
          },
          "diagram": {
            "x": 6106,
            "y": 5205.5
          },
          "outcomes": {
            "ready": "1b338c12-eb72-50eb-a6df-ade9e94b557c",
            "needs_clarification": "68b6f7b3-cbe3-5a08-962b-6c9ec93b85f4",
            "unsupported": "45370de8-b59e-5404-b9ab-13ed71682642"
          },
          "inputs": [
            {
              "id": "2c86757f-f43b-5d82-9c05-4ee399488e4d",
              "name": "caseExpression",
              "type": "string",
              "value": "{{$context.$nodes.VALIDATE_REQUEST.$output.result.status}}"
            }
          ]
        },
        {
          "id": "1b338c12-eb72-50eb-a6df-ade9e94b557c",
          "code": "READY_RESPONSE",
          "type": "RETURN",
          "metadata": {
            "name": "Ready Response"
          },
          "diagram": {
            "x": 6556,
            "y": 5000
          },
          "outcomes": {},
          "inputs": [
            {
              "id": "068d84f2-0873-5e28-bb6b-39356fc3be0b",
              "name": "returnValue",
              "type": "string",
              "value": "Ready to review request {{$context.$nodes.VALIDATE_REQUEST.$output.result.requestId}}: {{$context.$nodes.VALIDATE_REQUEST.$output.result.item}} (quantity {{$context.$nodes.VALIDATE_REQUEST.$output.result.quantity}}). No order has been placed or approved."
            }
          ]
        },
        {
          "id": "68b6f7b3-cbe3-5a08-962b-6c9ec93b85f4",
          "code": "CLARIFICATION_RESPONSE",
          "type": "RETURN",
          "metadata": {
            "name": "Clarification Response"
          },
          "diagram": {
            "x": 6556,
            "y": 5222
          },
          "outcomes": {},
          "inputs": [
            {
              "id": "f92637a1-4b89-5e68-b291-02be6543f579",
              "name": "returnValue",
              "type": "string",
              "value": "Please clarify the request. {{$context.$nodes.VALIDATE_REQUEST.$output.result.reason}}"
            }
          ]
        },
        {
          "id": "45370de8-b59e-5404-b9ab-13ed71682642",
          "code": "UNSUPPORTED_RESPONSE",
          "type": "RETURN",
          "metadata": {
            "name": "Unsupported Response"
          },
          "diagram": {
            "x": 6556,
            "y": 5444
          },
          "outcomes": {},
          "inputs": [
            {
              "id": "1537b85f-06a0-5c6c-ab39-7cd0936aa4a2",
              "name": "returnValue",
              "type": "string",
              "value": "{{$context.$nodes.VALIDATE_REQUEST.$output.result.reason}} No business action was performed."
            }
          ]
        },
        {
          "id": "d5ada406-5bfb-5dff-99d6-8f669b51a926",
          "code": "UNEXPECTED_RESULT",
          "type": "RETURN",
          "metadata": {
            "name": "Unexpected Result"
          },
          "diagram": {
            "x": 5000,
            "y": 5616
          },
          "outcomes": {},
          "inputs": [
            {
              "id": "b4b181db-bf7d-5367-881a-b89ab1abf0da",
              "name": "returnValue",
              "type": "string",
              "value": "The request could not be validated. Review the workflow run before trying again. No equipment order has been placed."
            }
          ]
        },
        {
          "id": "f609b7c3-bf02-5289-814b-0fc49e398c2c",
          "code": "END",
          "type": "END",
          "metadata": {
            "name": "End",
            "description": "End of data pipeline"
          },
          "outcomes": {},
          "inputs": []
        }
      ],
      "rootNode": "a0b12a96-6e5c-5c9d-b5c8-cbc5b636fe5c",
      "variables": [],
      "errorHandlers": []
    },
    "modelConfiguration": null,
    "humanApprovalFlag": false,
    "waitFlag": false,
    "triggers": [
      {
        "type": "REST",
        "inputs": []
      }
    ],
    "deletedTriggerTypes": [],
    "answerInUserLanguage": false,
    "userLanguagePrompt": "",
    "chatExpTPFileUploadEnabledFlag": false,
    "chatExpThirdPartyDetails": [],
    "defaultModelConfiguration": "ORA_MODEL_CONFIG_PREMIUM_OPEN_AI_GPT_4_1_MINI",
    "diagram": {
      "orientation": "horizontal",
      "commentNodes": []
    }
  },
  "status": "DRAFT",
  "version": 1,
  "family": "COMMON",
  "product": "OTHER",
  "customFlag": false,
  "aiAppsCompatibleFlag": false,
  "hiddenFlag": false,
  "seededFlag": false,
  "useCaseId": "1aa7357a-595a-5010-98d5-27277cbaca5d",
  "accessModifier": "public",
  "architecture": "data_pipeline",
  "isTemplate": false,
  "followupEnabledFlag": false
}
