# 04c — NASK: GenerateWebSearchQnsForResolutionPlan

> **Release:** Zurich | **Flow:** Veritas Resolution Agentic Workflow — Fallback Path (after internal KB and Elastic log analysis) **Sources:** [NASK Tool & Deployment Options — ServiceNow Community](https://www.servicenow.com/community/now-assist-articles/now-assist-skill-kit-tool-and-deployment-options/ta-p/3284803) | [Now Assist Skill Kit Docs — Zurich](https://www.servicenow.com/docs/bundle/zurich-intelligent-experiences/page/administer/now-assist-skill-kit/concept/now-assist-skill-kit-landing.html)

***

## What This Doc Covers

This document walks through building the **`GenerateWebSearchQnsForResolutionPlan`** skill — a custom Now Assist skill that bridges internal incident data and external internet search. It is the **fallback resolution path** in the Veritas workflow: invoked when AI Search (RAG over KB), PI or querying log entries within Elastic MCP Server has not produced a resolution.

The skill does two things in sequence:

1. Calls a **pre-processing tool** — another published NASK skill (`CreateOptimalSearchQuery`) — to retrieve a privacy-safe, LLM-optimised search query from the Incident Extend record
2. Passes that query to the **skill prompt** which generates a structured set of targeted web search questions to drive an actionable Resolution Plan

This is a **skill-chaining** pattern: a skill calling another published skill as a tool — one of the most powerful composition patterns.

***

## Where This Fits in the Agentic Workflow (Veritas Architecture)

![NASK Web Search Flow Overview](/files/RpAZyEcdqb2au6haj7Vm)

***

## Skill Overview

| Field                 | Value                                                                                                                                                            |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Skill name            | `GenerateWebSearchQnsForResolutionPlan`                                                                                                                          |
| Skill type            | Custom skill                                                                                                                                                     |
| Default provider      | Now LLM Service — Now LLM Generic                                                                                                                                |
| Available models      | llm\_generic\_small\_v2, llm\_generic\_small\_v1, llm\_generic\_large, llm\_generic\_small, pii\_anonymize\_v2, llm\_generic\_large\_v1, llm\_generic\_large\_v2 |
| Input                 | `incidentextendrecord` (String) — Record Number from Incident Extend table                                                                                       |
| Outputs               | provider, response, error, errorCode, status (all String)                                                                                                        |
| Tool                  | `RetrieveGeneratedSearchQuerythatwasforAI` → calls `CreateOptimalSearchQuery` skill                                                                              |
| Tool condition        | None (Always run)                                                                                                                                                |
| Prompt                | `Generate Web Search Questions for Resolution Plan`                                                                                                              |
| Workflow (deployment) | Other                                                                                                                                                            |
| User access           | Any authenticated user                                                                                                                                           |
| Role restrictions     | `itil, x_snc_apacaienable.incident_extend_user`                                                                                                                  |
| Status                | Active                                                                                                                                                           |

***

## Understanding Web Search in NASK

Before building this skill it's important to understand what the **Web Search tool type** is — and why it is *not* used directly here.

### The NASK Web Search Tool (Native)

NASK introduced a native **Web Search** tool type in version **3.1.3** (Xanadu Patch 7 / Yokohama Patch 1). It allows a custom skill to directly call an external internet search API and inject results into the prompt context. It supports two modes:

| Mode                  | How it works                                                                                          |
| --------------------- | ----------------------------------------------------------------------------------------------------- |
| **Search and Scrape** | Queries a search engine, scrapes the top results, and injects summarised content into the prompt      |
| **AI Answers**        | Queries a search engine and generates an AI-synthesised answer from results, injected into the prompt |

**Important constraint:** The native Web Search tool requires your organisation to **provide and maintain its own API keys** for the external search service (e.g. Bing Search API, Google Custom Search API, Brave Search, etc.). ServiceNow does not provide search API credentials.

> **Why this matters for the lab:** In this AILab2.0 setup, instead of using the native Web Search tool directly (which requires a paid external API key), the skill uses a **skill-chaining approach** — calling `CreateOptimalSearchQuery` as a tool to retrieve the pre-generated query, then constructing targeted web search questions via the LLM prompt. The actual web search execution is handled downstream in the Resolution Pathfinder for Incident case Agent (Fulfiller Agent).

### Skill as a Tool (Skill Chaining)

Available from NASK version **3.0.1** (Xanadu Patch 3). This allows a published skill to be called as a tool node inside another skill. Key rules:

* The target skill **must be published** to appear as an option
* Any inputs required by the target skill must be mapped in the tool configuration
* Skills can use different LLMs — no restriction on chaining across providers
* The tool node exposes the called skill's **outputs** (provider, response, error, errorCode, status) for use in the parent skill's prompt

***

## Lab Exercise — Step-by-Step Build

### Prerequisites

| Requirement                      | Detail                                                               |
| -------------------------------- | -------------------------------------------------------------------- |
| Now LLM Service or Azure OpenAI  | LLM provider configured in the instance                              |
| `CreateOptimalSearchQuery` skill | Must be **published** (not just saved) — it is called as a tool here |
| Incident Extend table            | `x_snc_apacaienable_incident_extend` populated                       |

***

### Step 1: Create the Skill — General Info

Navigate to **All → Now Assist Skill Kit → Home → Create skill**.

The **New skill** wizard opens on **General info**.

![General info — skill name and description](/files/rNNOFlZqnlS0imMIMR1B)

Configure the skill identity:

| Field       | Value                                                                                                                                                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Skill name  | `GenerateWebSearchQnsForResolutionPlan`                                                                                                                                                                                        |
| Description | `This skill is created to take in the 'Optimal Search Query' that was created to search against ServiceNow's AI Search and then create a set of web search questions in order to drive towards an actionable Resolution Plan.` |

> Skill names use letters, numbers, dashes, and underscores — no spaces or symbols. The description surfaces in Now Assist Admin and the Skill catalogue.

**Choose default provider:**

| Field                | Value             |
| -------------------- | ----------------- |
| Default provider     | `Now LLM Service` |
| Default provider API | `Now LLM Generic` |

The available models shown under Now LLM Generic include the full NowLLM model family: `llm_generic_small_v2`, `llm_generic_small_v1`, `llm_generic_large`, `llm_generic_small`, `pii_anonymize_v2`, `llm_generic_large_v1`, `llm_generic_large_v2`.

***

### Step 2: Configure Security Controls

Scroll down on the General info page to reach **Configure security controls**.

![Security controls — ACL and role restrictions](/files/julrznp8niAmfSEic3hv)

**Define user access with an ACL:**

| Field       | Value                    |
| ----------- | ------------------------ |
| User access | `Any authenticated user` |

> "As long as a user is logged in, they can access this skill." This is appropriate for an internet-facing fallback skill used by fulfiller agents — any authenticated ITIL user in the Veritas workflow can invoke it.

**Apply role restrictions to skill:**

| Field | Value                                           |
| ----- | ----------------------------------------------- |
| Roles | `itil, x_snc_apacaienable.incident_extend_user` |

> Role restrictions cap the maximum privilege level the skill inherits during execution — even if the invoking user has admin, the skill runs within defined bounds. This is a security best practice: skills should operate with least-privilege.

Click **Continue**.

***

### Step 3: Add Skill Input and Rename the Prompt

After creation, the skill lands on **Step 1: Edit prompt**. Before authoring the prompt or adding tools, two setup tasks are required: defining the skill input and renaming the default prompt.

***

#### Step 3a — Add the Skill Input

The Skill contents panel on the left initially shows **Inputs: None added**. Click the **+** next to Inputs to open the **Add skill input** dialog.

![NASK — Add Skill Input: incidentextendrecord](/files/A0ve82wvMqW98IbmbcpX)

Configure the following fields:

| Field                | Value                                      |
| -------------------- | ------------------------------------------ |
| Datatype             | `String`                                   |
| Name                 | `incidentextendrecord`                     |
| Description          | `Record Number from Incident Extend table` |
| Make input mandatory | Unchecked                                  |
| Allow truncation     | Unchecked                                  |

Click **Add skill input**.

> `incidentextendrecord` is the runtime identifier — the Incident record number — passed in when the Agentic Workflow invokes this skill. It threads through to the tool as `{{incidentextendrecord}}`.

***

#### Step 3b — Rename the Prompt

With the input added, the Skill contents panel now shows **inputs (1)** with `incidentextendrecord` listed. The prompt still shows the NASK default name **Incident Summarization** — this is misleading, as this skill generates web search questions, not incident summaries.

1. In the **Skill contents** panel, expand **Prompts** → **Now LLM Service** → **Now LLM Generic**
2. Click on **Incident Summarization** to select it
3. Click the **pencil icon** next to the prompt name to open the **Edit prompt name** dialog

![NASK — Edit Prompt Name: Incident Summarization with pencil icon](/files/Xq7rFRuebWbjBf6O7Rth)

4. Change the **Name** from `Incident Summarization` to `Generate Web Search Questions for Resolution Plan`
5. Click **Save changes**
6. Confirm the prompt name now displays as **Generate Web Search Questions for Resolution Plan** in both the Skill contents panel and the prompt editor header

![NASK — Prompt Renamed to Generate Web Search Questions for Resolution Plan](/files/A2zuqbbkmrOhKI3pJevQ)

> The prompt name appears throughout the skill — on the canvas (as the Skill prompt node label), in the Publish dialog, and in the finalized prompt selector. Renaming it now ensures consistency across all surfaces.

***

### Step 4: Add Tools — Open Tool Canvas

Navigate to **Step 2: Add tools**.

The canvas shows **Start → Skill prompt → End**. Click the **+** connector between Start and the Skill prompt node to insert a tool node before the prompt fires.

![Add node dialog — Tool node selection](/files/XmJI9BF9NB8h7egdrTcT)

Select **Tool node** and click **Add**.

The tool type picker opens.

![Add skill as a tool — Tool type picker](/files/F5qkkTGRglb30YmVwbI2)

Select **Skill** as the tool type and click **Configure tool**.

> This activates the **skill-chaining** pattern — a published NASK skill used as a pre-processing tool to inject its output into the parent skill's prompt context.

***

### Step 5: Configure Skill Tool — General Info

The **Add skill as a tool** wizard opens (5-step: General info → Tool inputs → Tool outputs → Tool conditions → Summary).

![Add skill as a tool — General info](/files/8dEReFsjjLXBSq5TlF1x)

**Step 1 — General info:**

| Field        | Value                                                                                                           |
| ------------ | --------------------------------------------------------------------------------------------------------------- |
| Name         | `RetrieveGeneratedSearchQuerythatwasforAI`                                                                      |
| Description  | `This skill is created to generate the optimal search query for AI Search to be returned with the best results` |
| Resource     | `CreateOptimalSearchQuery`                                                                                      |
| Provider API | `Chat Completion` (auto-populated from the resource skill's provider)                                           |

> The **Resource** field references the published `CreateOptimalSearchQuery` skill (built in [doc 04a-now-assist-skill-kit-createoptimalsearchqueryskill.md](/sn-ai-lab/phase-2-fulfiller-flow/04a-now-assist-skill-kit-createoptimalsearchqueryskill.md)). A platform warning appears: *"Ensure that Access Control Lists (ACLs) are correctly configured for the resource so that the skill can access it."* — verify that `CreateOptimalSearchQuery` has `itil and x_snc_apacaienable.incident_extend_user` as its role restriction and `Any authenticated user` access, matching the parent skill.

Click **Continue**.

***

### Step 6: Configure Skill Tool — Tool Inputs

![Add skill as a tool — Tool inputs](/files/QaiuGtY8WZD7lqQDSy7x)

**Step 2 — Tool inputs:**

| Name                   | Datatype | Value                      |
| ---------------------- | -------- | -------------------------- |
| `incidentextendrecord` | string   | `{{incidentextendrecord}}` |

> This maps the parent skill's input directly through to the child skill. `{{incidentextendrecord}}` is the Mustache-style variable syntax NASK uses to reference skill inputs at runtime. The child skill (`CreateOptimalSearchQuery`) receives the same incident record identifier and uses it to retrieve the incident extend fields and generate the optimal query.

Click **Continue**.

***

### Step 7: Configure Skill Tool — Tool Outputs

![Add skill as a tool — Tool outputs](/files/8BygAlaIxFQDuwtyojwQ)

**Step 3 — Tool outputs:**

The called skill (`CreateOptimalSearchQuery`) returns the standard NASK skill output set:

| Name        | Type   | Description                                                                              |
| ----------- | ------ | ---------------------------------------------------------------------------------------- |
| `provider`  | string | LLM provider used by the child skill                                                     |
| `response`  | string | **The generated optimal search query string** — primary output used by the parent prompt |
| `error`     | string | Error message if the child skill failed                                                  |
| `errorCode` | string | Error code if applicable                                                                 |
| `status`    | string | Execution status (success / error)                                                       |

> `response` is the key output. It contains the privacy-safe, LLM-generated search query produced by `CreateOptimalSearchQuery`. In the parent skill's prompt template, this is referenced as `{{RetrieveGeneratedSearchQuerythatwasforAI.response}}`. Truncation is available per field — leave unchecked unless token limits are hit in testing.

Click **Continue**.

***

### Step 8: Configure Skill Tool — Tool Conditions

![Add skill as a tool — Tool conditions](/files/cVgjMEOptBHOv7mQlEPa)

**Step 4 — Tool conditions (optional):**

| Field | Value                 |
| ----- | --------------------- |
| Type  | **None (Always run)** |

> Tool conditions allow you to skip a tool based on a script or filter evaluation — for example, skipping the web search if a retriever already found results (a common pattern using Decision Nodes). For this skill, `None (Always run)` is correct: the child skill must always fire because the parent prompt has no search query context without it.

Click **Continue**.

***

### Step 9: Review Tool Summary

![Add skill as a tool — Summary](/files/zw1IV13KYez2hpEa2cWP)

**Step 5 — Summary:**

| Section         | Field                | Value                                                                                                           |
| --------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- |
| Type            | —                    | Skill                                                                                                           |
| General info    | Name                 | `RetrieveGeneratedSearchQuerythatwasforAI`                                                                      |
| General info    | Description          | `This skill is created to generate the optimal search query for AI Search to be returned with the best results` |
| General info    | Resource             | `CreateOptimalSearchQuery`                                                                                      |
| General info    | Provider API         | Chat Completions                                                                                                |
| Inputs          | incidentextendrecord | `{{incidentextendrecord}}`                                                                                      |
| Outputs         | provider             | string                                                                                                          |
| Outputs         | response             | string                                                                                                          |
| Outputs         | error                | string                                                                                                          |
| Outputs         | errorCode            | string                                                                                                          |
| Outputs         | status               | string                                                                                                          |
| Tool conditions | Type                 | none                                                                                                            |

Click **Add tool**.

***

### Step 10: Verify the Execution Canvas

After adding the tool, the canvas updates to show the full skill execution flow:

![Tool canvas with skill tool and skill prompt nodes](/files/zwrcexQALz71LaPqMMIH)

```
Start
  │
  ▼
RetrieveGeneratedSearchQuerythaswas...   ← Skill tool node (calls CreateOptimalSearchQuery)
  │
  ▼
Generate Web Search ...                  ← Skill prompt node
  │
  ▼
End
```

The left panel shows **Tools** → `RetrieveGeneratedSearchQuerythaswas` (truncated display name).

> The canvas execution order matters: the tool node fires **before** the prompt node. This ensures `CreateOptimalSearchQuery` has run and its `response` output is available for the prompt template to reference via `{{RetrieveGeneratedSearchQuerythatwasforAI.response}}` before the LLM processes the prompt.

***

### Step 11: Author the Skill Prompt

Navigate back to **Step 1: Edit prompt** to view and edit the prompt template. Click on the Generate Web Search Questions for Resolution Plan prompt in the Skill contents panel to open the prompt editor.

![Prompt editor — Generate Web Search Questions for Resolution Plan](/files/Uwwfq75mld7GkofcCSfE)

The prompt for this skill is provided in the lab repository. Copy the full prompt text from the following link listed in step 1 and paste it into the **Prompt** text area:

1. Open the file at [`../NASKprompts/GenerateWebSearchQnsForResolutionPlan-Prompt`](https://raw.githubusercontent.com/raadlakha/AILab2.0/main/NASKprompts/GenerateWebSearchQnsForResolutionPlan-Prompt) in the lab repository
2. **Read through the entire prompt before pasting anything.** Understand what the prompt is asking the LLM to do, how the input schema is structured, what privacy constraints are applied, and what the expected output format looks like
3. Copy the prompt text and paste it into the **Prompt** field in the NASK editor
4. **Review and adapt the prompt to your environment.** Agentic Workflow systems are intelligent systems that adapt to their surroundings — the prompt should reflect your specific context. Consider the following as you review:

| Area to Review         | What to Consider                                                                                                                                                                                  |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| INPUT FORMAT fields    | Do the field names and descriptions match the data your Incident Extend table actually produces? If you have added custom fields beyond the standard set, consider referencing them here          |
| Privacy constraints    | Are the rules around stripping internal hostnames, IPs, and user data appropriate for your organisation's security posture? You may need to tighten or loosen these depending on your environment |
| Output format          | Does the expected output structure (single optimised query vs. multiple questions) align with how the downstream Web Search tool consumes the result?                                             |
| Examples in the prompt | Are the provided examples representative of the types of incidents your lab environment generates? If your Veritas NetBackup scenarios differ, adjust the examples accordingly                    |
| Tone and specificity   | Is the prompt too generic or too narrow for the error codes and product types in your extended incident data? Tailor the language to match your narrative                                         |

5. Verify that the prompt references the tool output variable `{{RetrieveGeneratedSearchQuerythatwasforAI.response}}` — this is how the optimised query from the upstream `CreateOptimalSearchQuery` skill is injected into the prompt context
6. Click **Save** to save the prompt

> **Do not copy blindly.** The provided prompt is a proven starting point (\~1026 words) that has been tested against the Veritas NetBackup triage scenario — but it is not immutable. The strength of an agentic system lies in its ability to adapt. As you build out the full workflow and observe how the LLM responds to real incident data in your lab instance, you will likely find areas where the prompt benefits from refinement: tighter constraints, additional examples, adjusted output formatting, or domain-specific terminology. Treat prompt authoring as an iterative process — finalize v1 now, test it end-to-end, and create v2 when you identify improvements.

**Key prompt design decisions:**

| Decision                                   | Rationale                                                                         |
| ------------------------------------------ | --------------------------------------------------------------------------------- |
| Structured INPUT FORMAT with fixed fields  | Forces consistent context injection regardless of incident data quality           |
| Privacy constraints in prompt rules        | Prevents internal system details leaking into externally-visible search queries   |
| Output: single optimised query string      | Downstream Web Search tool expects a single query, not a list                     |
| `web-search-optimised` framing in preamble | Guides the LLM to produce queries with search-engine semantics, not NLP questions |

***

### Step 12: Test the Prompt

Before publishing, use the built-in **Test prompt** feature to validate that the skill-chaining pipeline executes correctly and that the LLM produces a well-formed web search query.

1. In the NASK skill editor, locate the **Test prompt** panel (right-hand side of the prompt editor)
2. Click the **Run test** button — the **Run test** dialog opens
3. In the `incidentextendrecord` input field, enter an existing Incident Extend record number — for example: **`INCE0012002`**
4. Ensure **Test prompt after applying security controls** is checked — this validates that the skill's ACL configuration allows the test to execute correctly
5. Click **Run test**

![NASK — Run Test Dialog: Input and Security Controls](/files/o2wnQ8EfjAgjYGpglKWU)

> **Which record to use?** Use an Incident Extend record that has been processed by NADI and has populated fields (error code, product name, CI, etc.). Records created during the L1 Agent testing (e.g., `INCE0012002`) are ideal. The upstream `CreateOptimalSearchQuery` skill needs populated fields to generate a meaningful query — testing with an empty record will produce a sparse or generic output.

6. Wait for the test to complete — the **Response** tab in the Test prompt panel will display the LLM-generated output
7. Review the response and verify that it is a **single, web-search-optimised query string** — not a list of questions, not a conversational paragraph, and not an incident summary
8. Once the prompt is finalised and testing of the skill is successful, click on **Manage prompt** → **Finalize prompt** to lock the prompt version

![NASK — Test Prompt Response: Web Search Query](/files/ixNfffSJAgnZ7ofdgLqe)

> **What to verify:**

| Check                  | Expected Behaviour                                                                                                                                                                                          |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Output format          | A single concise query string — suitable for pasting directly into a search engine                                                                                                                          |
| Product identification | Query includes the product name and model (e.g., `Veritas NetBackup Appliance 5240`)                                                                                                                        |
| Error code inclusion   | Query includes the error code in a search-friendly format (e.g., `"status code 84"` with quotes for exact matching)                                                                                         |
| Problem context        | Query includes the fault type and intent (e.g., `hardware fault troubleshooting resolution`)                                                                                                                |
| Privacy safety         | Query does not contain internal hostnames, IP addresses, serial numbers, or user names — only product, error, and problem descriptors                                                                       |
| Skill chaining         | Click the **Tools** tab to confirm `RetrieveGeneratedSearchQuerythatwasforAI` executed successfully — this validates that the upstream `CreateOptimalSearchQuery` skill was invoked and returned a response |

> **Why a single query string?** The downstream Fulfiller Agent's Web Search tool expects a single search query as input — not a list of questions. The prompt is specifically designed to produce a search-engine-optimised string that combines the product, error code, and problem context into one query that maximises relevance when executed against the internet. If the response contains multiple questions or a narrative paragraph, revisit the prompt (Step 11) and tighten the output format instructions.

9. If the response does not match the expected format, return to the prompt editor (Step 11) and adjust the output constraints — then re-finalize and re-test

> **Tip:** Click the **Grounded prompt** tab to inspect the fully rendered prompt sent to the LLM — this shows the actual value substituted for `{{RetrieveGeneratedSearchQuerythatwasforAI.response}}`. If the substituted value is empty or malformed, the issue is in the upstream `CreateOptimalSearchQuery` skill, not in this skill's prompt.

> **Finalize vs. Save:** Saving preserves your edits as a working draft. Finalizing locks the prompt as an immutable version (`v1`, `v2`, etc.) that can be selected for publishing. You must finalize at least one version before the prompt appears in the Publish dialog (Step 12). You can continue editing the draft after finalizing — subsequent finalizations create new versions without overwriting previous ones.

***

### Step 13: Publish the Skill

Navigate to **Step 4: Deployment and skill settings** → click **Publish skill** (top right).

The **Publish Skill** dialog opens:

![Publish Skill dialog](/files/Q4PtlQz9QlZgYPdHiJv9)

Review deployment settings:

| Field           | Value          |
| --------------- | -------------- |
| Workflow        | Other          |
| Product         | Not Applicable |
| Feature         | Not Applicable |
| Display Options | None           |

Under **Select which finalized prompts to include in the Published skill:**

| Provider                                             | Prompt                                                   | Action    |
| ---------------------------------------------------- | -------------------------------------------------------- | --------- |
| Now LLM Service (Now LLM Generic) — Default provider | `Generate Web Search Questions for Resolution Plan (v1)` | ✅ Checked |

Click **Publish**.

> A prompt must be **finalized** before it appears here. Finalization locks a prompt version (v1, v2, etc.). Publishing deploys the skill to the Now Assist ecosystem. These are separate actions — you can have multiple finalized versions and choose which to publish.

***

### Step 14: Configure Deployment Settings

In **Step 4: Deployment and skill settings**, select **Deployment settings** from the left nav.

![Deployment settings — Workflow = Other](/files/eS8u0BEO5bcxHN6ltzyF)

| Field    | Value         |
| -------- | ------------- |
| Workflow | `Other`       |
| Product  | (leave blank) |

> **Workflow = Other** places the skill in the **Now Assist Skills → Other** category in Now Assist Admin. This is the correct placement for custom skills that are used programmatically (by agents or flows) rather than being deployed to a specific product surface (ITSM, HRSD, etc.).

***

### Step 15: Activate the Skill

Navigate to **All → Admin Center → Now Assist Admin → Now Assist Skills → Other**.

![Now Assist Admin — Skills — Other — GenerateWebSearchQnsForResolutionPlan](/files/wvHSDiZJ1mpY1dgIbUuw)

Locate `GenerateWebSearchQnsForResolutionPlan` under the **Available** tab in the **Other** workflow.

Click **Turn on**.

![Successfully activated confirmation](/files/Qg6ySCYPfUzElwheOwON)

The **"Successfully activated"** confirmation dialog appears:

> **GenerateWebSearchQnsForResolutionPlan is now active**

Click **Done**.

> **Publishing alone is not sufficient.** The skill must be **Active** in Now Assist Admin for it to be callable by agents, flows, or as a tool by other skills. Activation creates the runtime link between the published skill and the Now Assist execution engine.

***

## Key Configuration Summary

| Field                 | Value                                                       |
| --------------------- | ----------------------------------------------------------- |
| Skill name            | `GenerateWebSearchQnsForResolutionPlan`                     |
| Skill type            | Custom skill                                                |
| Default provider      | Now LLM Service → Now LLM Generic                           |
| Skill input           | `incidentextendrecord` (String) — test value: `INCE0012002` |
| Tool type             | Skill (skill-chaining)                                      |
| Tool name             | `RetrieveGeneratedSearchQuerythatwasforAI`                  |
| Tool resource         | `CreateOptimalSearchQuery` (published skill)                |
| Tool input            | `incidentextendrecord` → `{{incidentextendrecord}}`         |
| Tool key output       | `response` — the optimised query string                     |
| Tool condition        | None (Always run)                                           |
| Prompt                | `Generate Web Search Questions for Resolution Plan (v1)`    |
| Prompt size           | \~1026 words                                                |
| Workflow (deployment) | Other                                                       |
| User access           | Any authenticated user                                      |
| Role restrictions     | `itil, x_snc_apacaienable.incident_extend_user`             |
| Final status          | Active                                                      |

***

## Technical Deep Dive

### Skill Chaining: How Output Variables Flow

When NASK executes a skill-as-tool, the child skill's outputs become available as template variables in the parent prompt using dot notation:

```
{{<tool_name>.<output_field>}}
 
Example:
{{RetrieveGeneratedSearchQuerythatwasforAI.response}}
```

This is how the parent prompt receives the optimal query string generated by `CreateOptimalSearchQuery`. The LLM processing the parent prompt sees the query inline within the prompt context — not as a separate API call.

### Execution Order and Token Budget

The tool node fires **before** the LLM processes the prompt. The grounded prompt (what the LLM actually receives) contains the fully resolved tool outputs substituted into the template. This means:

* Tool execution failures surface before the LLM is called
* Token budget must accommodate both the prompt template **and** all tool output values
* For this skill: the `CreateOptimalSearchQuery` response is a short query string (typically 5–15 words) — minimal token overhead

### Why Not Use the Native Web Search Tool?

The native NASK Web Search tool (v3.1.3+) directly calls an external search API. In the Veritas lab context:

| Factor                    | Native Web Search                  | Skill-Chaining Approach                                           |
| ------------------------- | ---------------------------------- | ----------------------------------------------------------------- |
| External API key required | Yes — org must provide and manage  | No — no external dependency                                       |
| Search execution          | Happens inside the skill           | Happens in the downstream Veritas agent (Capability 10)           |
| Query optimisation        | Passes raw input to search API     | LLM-generated, privacy-safe query from `CreateOptimalSearchQuery` |
| Privacy control           | Must configure domain restrictions | LLM strips internal identifiers in the upstream skill             |
| Suitable for              | Standalone web-augmented skills    | Multi-agent workflows where search is a separate agent action     |

> In a production agentic workflow, the two approaches are complementary: the native Web Search tool is ideal for self-contained skills that need real-time web grounding; the skill-chaining pattern is ideal when web search is one step in a larger orchestrated resolution workflow.

### Decision Nodes — Advanced Pattern

For production hardening of this skill, consider adding a **Decision Node** (available from NASK v3.0.1) between the tool node and the prompt node:

```
Start
  │
  ▼
RetrieveGeneratedSearchQuery (tool)
  │
  ▼
Decision Node: did tool return a non-empty response?
  ├── TRUE → Skill prompt (generate web search questions)
  └── FALSE → End (or fallback skill)
```

This prevents the LLM prompt from firing if `CreateOptimalSearchQuery` failed or returned an empty response — saving LLM calls and producing a cleaner error state.

### Troubleshooting

Use the **Test prompt** section in Step 3 (Optimize and evaluate) to debug:

| Tab                 | What it shows                                                                                                                                                              |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Grounded prompt** | The full prompt delivered to the LLM, with all tool outputs substituted in — use this to verify `{{RetrieveGeneratedSearchQuerythatwasforAI.response}}` resolved correctly |
| **Tools**           | Input sent to and response received from each tool individually — use this to verify `CreateOptimalSearchQuery` is returning a valid query                                 |

Common issues:

| Symptom                                 | Likely cause                                                | Fix                                                               |
| --------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------- |
| Tool output is empty                    | `CreateOptimalSearchQuery` not published or inactive        | Publish and activate the upstream skill                           |
| Skill not appearing in Now Assist Admin | Not activated                                               | Run Turn on in Now Assist Admin → Other                           |
| Empty response from skill               | `incidentextendrecord` test value not found in extend table | Verify INCE0012002 exists in `x_snc_apacaienable_incident_extend` |

***

## Reference

* [NASK Tool & Deployment Options — ServiceNow Community](https://www.servicenow.com/community/now-assist-articles/now-assist-skill-kit-tool-and-deployment-options/ta-p/3284803)
* [NASK FAQ — ServiceNow Community](https://www.servicenow.com/community/now-assist-articles/now-assist-skill-kit-nask-faq/ta-p/3007953)
* [Add a tool — ServiceNow Docs](https://www.servicenow.com/docs/csh?topicname=add-a-tool.html\&version=latest)
* [Add Web Search tool — ServiceNow Docs](https://www.servicenow.com/docs/csh?topicname=add-web-search.html\&version=latest)

***

## Next Steps

→ This skill outputs a set of structured web search questions targeting the incident's unresolved error.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sn-ai-platform.gitbook.io/sn-ai-lab/phase-2-fulfiller-flow/04c-now-assist-skill-kit-web-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
