{
  "$schema": "https://www.cuddler.dev/standards/document-role/process/v1.0.0/questionnaire.schema.json",
  "questionnaireId": "capture-context",
  "title": "Capture Context",
  "summary": "Extract the facts needed for the rest of the workflow.",
  "instructions": "# Capture Context\n\nReview the lead request and record the customer, requested service, deadline, blockers, and unanswered questions.",
  "format": "markdown",
  "entryQuestionId": "customer-name",
  "questions": [
    {
      "questionId": "customer-name",
      "title": "Who is the customer?",
      "answerType": "short-text",
      "outputKey": "customerName",
      "conversation": [
        {
          "messages": [
            {
              "role": "system",
              "content": "You are running the Capture Context workflow step."
            },
            {
              "role": "assistant",
              "content": "Who is the customer for this request?"
            },
            {
              "role": "user",
              "content": "The customer is Contoso Manufacturing."
            }
          ]
        }
      ],
      "routing": {
        "default": {
          "nextQuestionId": "requested-service"
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when evaluating the completed conversation for this question.",
          "input": "",
          "output": "Return the normalized customer name captured from the completed conversation as a short text value."
        }
      ]
    },
    {
      "questionId": "requested-service",
      "title": "What service was requested?",
      "answerType": "long-text",
      "outputKey": "requestedService",
      "conversation": [
        {
          "messages": [
            {
              "role": "system",
              "content": "You are running the Capture Context workflow step."
            },
            {
              "role": "assistant",
              "content": "Describe the service or outcome the customer asked for."
            },
            {
              "role": "user",
              "content": "They asked for a phishing simulation and a short readiness review."
            }
          ]
        }
      ],
      "routing": {
        "default": {
          "nextQuestionId": "deadline-known"
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when evaluating the completed conversation for this question.",
          "input": "",
          "output": "Summarize the requested service or outcome in one normalized long-text answer."
        }
      ]
    },
    {
      "questionId": "deadline-known",
      "title": "Is there a known deadline?",
      "answerType": "select-one",
      "outputKey": "deadlineKnown",
      "options": [
        {
          "value": "known",
          "label": "Known",
          "description": "The customer gave a concrete deadline or date."
        },
        {
          "value": "unknown",
          "label": "Unknown",
          "description": "No concrete deadline was provided."
        }
      ],
      "conversation": [
        {
          "messages": [
            {
              "role": "system",
              "content": "You are running the Capture Context workflow step."
            },
            {
              "role": "assistant",
              "content": "Did the customer give a concrete deadline? Answer known or unknown."
            },
            {
              "role": "user",
              "content": "known"
            }
          ]
        }
      ],
      "routing": {
        "default": {
          "nextQuestionId": "blockers"
        },
        "rules": [
          {
            "condition": {
              "operator": "equals",
              "value": "known"
            },
            "target": {
              "nextQuestionId": "deadline"
            }
          },
          {
            "condition": {
              "operator": "equals",
              "value": "unknown"
            },
            "target": {
              "nextQuestionId": "blockers"
            }
          }
        ]
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when evaluating the completed conversation for this question.",
          "input": "",
          "output": "Return either known or unknown based on whether the completed conversation established a concrete deadline."
        }
      ]
    },
    {
      "questionId": "deadline",
      "title": "What is the deadline?",
      "answerType": "date",
      "outputKey": "deadline",
      "conversation": [
        {
          "messages": [
            {
              "role": "system",
              "content": "You are running the Capture Context workflow step."
            },
            {
              "role": "assistant",
              "content": "What is the deadline date for this request?"
            },
            {
              "role": "user",
              "content": "2026-04-15"
            }
          ]
        }
      ],
      "routing": {
        "default": {
          "nextQuestionId": "blockers"
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when evaluating the completed conversation for this question.",
          "input": "",
          "output": "Return the normalized deadline date in ISO 8601 full-date form when the completed conversation provides one."
        }
      ]
    },
    {
      "questionId": "blockers",
      "title": "Are there blockers or constraints?",
      "answerType": "long-text",
      "outputKey": "blockers",
      "conversation": [
        {
          "messages": [
            {
              "role": "system",
              "content": "You are running the Capture Context workflow step."
            },
            {
              "role": "assistant",
              "content": "List any blockers, constraints, or dependencies that were mentioned."
            },
            {
              "role": "user",
              "content": "They still need approval from legal and want the simulation scoped to one department."
            }
          ]
        }
      ],
      "routing": {
        "default": {
          "nextQuestionId": "unanswered-questions"
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when evaluating the completed conversation for this question.",
          "input": "",
          "output": "Return the blockers or constraints mentioned in the completed conversation as normalized long text."
        }
      ]
    },
    {
      "questionId": "unanswered-questions",
      "title": "What is still unanswered?",
      "answerType": "long-text",
      "outputKey": "unansweredQuestions",
      "conversation": [
        {
          "messages": [
            {
              "role": "system",
              "content": "You are running the Capture Context workflow step."
            },
            {
              "role": "assistant",
              "content": "What questions are still open after this intake conversation?"
            },
            {
              "role": "user",
              "content": "We still need the internal sponsor, the preferred test window, and the list of approved mail domains."
            }
          ]
        }
      ],
      "routing": {
        "default": {
          "complete": true
        }
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when evaluating the completed conversation for this question.",
          "input": "",
          "output": "Return the remaining unanswered questions or missing facts that still need follow-up."
        }
      ]
    }
  ]
}
