---
title: "Fix S22 Permission Denied on Workday Custom Agent Actions"
description: "Why a Custom Agent Action orchestration that succeeds in Orchestration Builder fails with S22 Permission Denied or task not authorized in Workday Agent Chat."
url: https://kiweely.com/guides/workday-custom-agent-actions-permission-denied-tool-wids
---

# Why Custom Agent Actions Fail With S22 Permission Denied or Task Not Authorized in Agent Chat

Orchestration Builder runs Custom Agent Actions directly as your user, whereas Agent Chat enforces dual ASOR authorization and restricts the Agent System User token to the resources listed in your .agentskill file. Register every REST, SOAP, and WQL resource WID via the Finder API to fix it.

-   **Checked** against Workday on November 6
-   Applies to **Workday Orchestrate**
-   4 min read
-   Published November 6
-   By Kiweely

## Why an orchestration succeeds in Orchestration Builder but fails in Agent Chat

When you test a **Custom Agent Action** orchestration inside Orchestration Builder on the Workday Developer Site, every **Send Workday API Request** step executes directly under your own signed-in user session without consulting the Agent System of Record (ASOR) tool boundary. When you invoke that exact same orchestration through Workday Agent Chat, the agent runtime routes the call through the Workday Agent Gateway using the agent’s **Agent System User (ASU)** credential.

If the agent runtime or a downstream Workday API call inside the orchestration isn’t authorized at both layers, Agent Chat fails with one of three errors even though the signed-in user holds the domain or role permissions:

-   `S22 Permission Denied` (or HTTP `403` on a REST step) when invoking the Custom Agent Action or a WQL query inside it
-   `The task submitted is not authorized` (or HTTP `401` on a SOAP step) when an orchestration step calls a Workday web service such as `Submit_Billing_Schedule` or `Get_Billing_Schedule`
-   `Unknown tool` (for example, `Unknown tool 'use-wql'`) when the agent attempts to call a resource directly by a non-catalog name or an unregistered identifier

## Two independent gates govern Custom Agent Action execution

Under the ASOR Delegate security model, a Custom Agent Action only succeeds when both the **Agent Skill resource list** and **user-plus-ASU domain security** align:

1.  **Every Workday resource called inside the orchestration must be declared in `tool-wids`:** When a Custom Agent launches a Custom Agent Action orchestration, the ASU access credential issued for that run is scoped strictly to the Workday resources registered on the agent’s skill. Listing only the Custom Agent Action’s **Action ID** lets the agent start the orchestration, but any **Send Workday API Request** step inside that orchestration (including steps inside suborchestrations) will fail with `403`, `401`, or `The task submitted is not authorized` unless the specific REST operation, SOAP operation, custom report, or WQL method WID is also listed in the `.agentskill` file’s `tool-wids` block.
2.  **Read-before-write SOAP and REST chains require all operation WIDs:** If your orchestration calls `Get_Billing_Schedule` first to read existing schedule lines and then calls `Submit_Billing_Schedule` to update them, registering only the `Submit_Billing_Schedule` WID still causes the run to fail on the initial read. Every operation touched during the run must be present in `tool-wids`.
3.  **Both the user and the underlying data sources require domain access:** Registering a resource WID on the agent skill allows the ASU token to call that API endpoint, but does not grant user data access. For WQL queries, both the signed-in user and the security groups configured in ASOR must have `View` access to the *Workday Query Language* (`WQL for Extend`) domain and every Primary Business Object (PBO), Related Business Object (RBO), and data source referenced in the `SELECT` and `WHERE` clauses.

## Discovering the exact resource WIDs with `/asor/v1/agentResourceSearch`

Do not guess tool names or copy paths from URL strings. Connect to your tenant on the Developer Site as a user with the *Agent Management Hub* and *Setup: Agents* domains, click **Copy Token**, and query the **Agent Resource Search API** (`GET /asor/v1/agentResourceSearch`) on your regional Agent Gateway host (`https://us.agent.workday.com` in the US—never the tenant’s own REST host, which rejects Developer Site tokens):

bash

```
curl --request GET \
  --url "https://us.agent.workday.com/asor/v1/agentResourceSearch?searchString=Billing%20Schedule&toolType=SOAP&operationType=VIEW" \
  --header "Accept: application/json"
```

Include your copied bearer credential in the `Authorization` header. Filter with `toolType` (`REST` or `SOAP`) and `operationType` (`VIEW` for `GET` or SOAP `Get_*`, `CREATE` for `POST`, and `PATCH` for `PATCH` or SOAP `Put_*` / `Submit_*`).

-   **Multiple matches:** When `agentResourceSearch` returns more than one entry with the same operation name, copy every returned `wid` into your skill definition.
-   **WQL method WIDs:** When an orchestration runs WQL via **Send Workday API Request**, include the WQL operation WID corresponding to the HTTP method your step uses:
    -   `GET /wql/v1/data`: `9749ba9ac47e1000073fdc1bc8a5001a`
    -   `POST /wql/v1/data`: `3e15b2a1676d10000c9572ea9cc264b3`
-   **Write SOAP operations omitted from search:** If a write SOAP operation does not appear in `agentResourceSearch`, run **Create Custom Report** in your tenant with **Report Type** set to *Advanced*, **Optimized for Performance** unchecked, and **Data Source** set to *Public Web Services* (or *All Public Service Operations* for REST), and output the `Web Service Operation` > `Workday ID` column.

## Registering the orchestration and its underlying APIs in `.agentskill`

Open your `.agentskill` file in App Builder (**Code Mode**) and list both the Custom Agent Action (`Action ID` from the orchestration’s **Start** step > **Configure Request** > **Custom Agent Actions** tab) and every underlying Workday API WID the orchestration invokes:

yaml

```
---
name: update-equipment-billing-schedule
description: "Retrieves an existing billing schedule and submits an updated schedule via the equipmentBillingAction orchestration."
metadata:
  tags:
    - billing
    - equipment-request
allowed-tools:
  - equipmentBillingAction
  - wqlGet
  - get_billing_schedule
  - submit_billing_schedule
tool-wids:
  - name: equipmentBillingAction
    wid: 4a81bc09d12e58749102bcdef1234567
  - name: wqlGet
    wid: 9749ba9ac47e1000073fdc1bc8a5001a
  - name: get_billing_schedule
    wid: 2c6143cd33da10000d22312205450221
  - name: submit_billing_schedule
    wid: c1941a9b6f071000142d9832a9865172
---
```

Formatting in `.agentskill` files is strict: any leading, trailing, or embedded space inside a `wid` value prevents the tool from registering in ASOR. Save and deploy the app, then sign out and back in to refresh your session’s access credential (an access credential issued prior to updating the registration does not carry the newly added resource WIDs).

## Verifying the fix in your tenant

1.  In **Agent Management Hub**, open your agent, go to the **Skills** tab, and click **View Security** to open the **View Security for Agent Skill** report.
2.  Inspect every tool row in the report for a **Functional Status** of **Review Required** or **Config Required**. Those statuses mean the security groups in the skill’s **Available To** list are missing from the domain or business process security policy that governs that API or WQL data source.
3.  For each flagged domain, open **Domain** > **Edit Domain Security Policy Permissions**, add the user security group (and any required app/ISU security group for Extend model domains), and run **Activate Pending Security Policy Changes**.
4.  Trigger the action again in Agent Chat and inspect the run on the Developer Site under **Orchestration Activity** (filtering by `OrchId` if an error occurred) and **Agent Traces** (`AviatoTurboChatCIS` node) to confirm all steps complete with HTTP `200`.

## Sources checked

-   [Troubleshoot Custom Agent Actions](https://developer.workday.com/documentation/GUID-71867a63-18bd-4b95-802c-2dc3cf90a3d1-enHYPHENus)
-   [Configure Custom Agent Action Orchestrations](https://developer.workday.com/documentation/GUID-fce1f988-5cf6-4d0c-ad1a-953bcfe212c6)
-   [Concept: ASOR Agent Resource Search API](https://developer.workday.com/documentation/GUID-3bcd2543-eaac-4a0e-b571-f3c5e84cef54-enHYPHENus)
-   [Discover Available Agent-Ready Tools](https://developer.workday.com/documentation/GUID-f86470b2-4283-48e6-8d7e-18c91c470878-enHYPHENus)
-   [Custom Agents on Workday's AI Platform](https://developer.workday.com/documentation/GUID-c3910467-0fd6-4f27-b78e-436cfe0a3147-enHYPHENus)

## Related guides

[All guides](https://kiweely.com/guides)

-   [### Why a Workday Custom Agent Has No Credentials Tab in Agent Management Hub, and How to Expose It Through A2A Workday displays the Credentials tab in Agent Management Hub only for registered External Agents. To expose a Custom Agent built on Workday’s AI platform to an external assistant, register a third-party Agent Definition in the Agent System of Record that wraps the Custom Agent WID as an A2A tool.](https://kiweely.com/guides/workday-custom-agent-missing-credentials-tab-a2a)
-   [### Passing Large CSV File Attachments From a Workday Custom Agent Flow to Orchestrate Without Hitting Context Limits Passing a multi-thousand-row CSV directly through a Custom Agent Action JSON input forces the LLM to serialize the entire file inside its context window. Store the uploaded CSV in an Extend Attachment Business Object via a PMD fileUploader widget and pass only the Attachment WID to Orchestrate.](https://kiweely.com/guides/workday-custom-agent-csv-file-attachment-orchestrate)
-   [### Preventing Duplicate Initiate\_Change\_Job Business Process Events When a Workday Custom Agent Calls a Write Tool When a Custom Agent write tool calls Initiate\_Change\_Job without returning a clear Change Job business process WID in its response payload, the LLM assumes the call did not produce a WID and retries. Return the explicit event WID, set Destructive annotations, and check for in-progress events.](https://kiweely.com/guides/workday-custom-agent-duplicate-initiate-change-job)
-   [### Why Custom Agent Skills Deployed From the Developer Site Don’t Appear in Agent Management Hub, and ASOR Tenant Prerequisites When you deploy a Custom Agent with multiple .agentskill files from App Builder, Workday’s Agent System of Record packages all of their tools into a single combined skill registration that starts disabled. Learn how to enable and sync skills in Agent Management Hub and verify ASOR prerequisites.](https://kiweely.com/guides/workday-agent-management-hub-skills-not-showing)

### More guides on Custom agents and Workday AI

[All 91 guides](https://kiweely.com/guides#custom-agents)

-   [Fixing invalid\_request OAuth Token Exchange Errors When Connecting Microsoft Copilot Studio to Workday A2A](https://kiweely.com/guides/workday-a2a-copilot-studio-oauth-invalid-request)
-   [Fixing Workday Developer Agent VS Code Sign-In With a Personal Developer Account and Subagent Interrupt Errors](https://kiweely.com/guides/workday-developer-agent-vscode-personal-account-login)
-   [Finding Workday tool IDs with the Agent Resource Search (finder) API](https://kiweely.com/guides/workday-finder-api-tool-discovery)
-   [Connecting an Extend app to the Workday Self-Service Agent and Microsoft Teams](https://kiweely.com/guides/workday-extend-self-service-agent-teams)
-   [How to build a chatbot in Workday Extend](https://kiweely.com/guides/workday-extend-chatbot)
-   [How to call AI Gateway Document Intelligence from a Workday Extend app](https://kiweely.com/guides/workday-extend-ai-gateway-document-intelligence)
-   [Who gets Workday Developer Agent, and what it uses in Flex Credits](https://kiweely.com/guides/workday-developer-agent-access-flex-credits)
-   [Connecting a Workday custom agent to an outside agent platform with A2A](https://kiweely.com/guides/workday-custom-agents-a2a-external-agents)

### From the blog on Custom agents and Workday AI

[All posts](https://kiweely.com/blog)

-   [Keeping Workday Studio Assemblies in Git When an AI Agent Proposes Changes](https://kiweely.com/blog/keep-workday-studio-assemblies-in-git-with-ai-changes)
-   [Board Briefing: Personal AI Agents vs Workday-Native Agents vs Desktop Co-Pilots](https://kiweely.com/blog/board-briefing-personal-vs-workday-native-vs-desktop-ai)
-   [Boutique Workday Firm Operating Model: One Senior Plus Agents vs Three Juniors](https://kiweely.com/blog/boutique-workday-firm-one-senior-plus-agents)

## Let Workday check the work.

Kiweely writes WQL and builds orchestrations in your own tenant, and Workday, not Kiweely, says whether they passed.

[Start for free](https://kiweely.com/download) [See how it works](https://kiweely.com/vine/how-it-works)

## Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.
