---
title: "Call Glean & Sana Agents From Workday Extend Without 408s"
description: "Why calling a Glean agent (/rest/api/v1/agents/runs/wait) or Sana webhook directly from an Extend PMD page fails with Status Code 408, and how to fix it."
url: https://kiweely.com/guides/workday-extend-external-agents-glean-sana-408-timeout
---

# Calling External Glean and Sana Agents From Workday Extend Without Hitting 408 Request Timeouts

Direct outbound HTTP calls from a Workday Extend PMD page time out with Status Code 408 when an external Glean agent (/rest/api/v1/agents/runs/wait) or Sana webhook exceeds the presentation timeout. Route external agent runs through Workday Orchestrate and External Client CredStore.

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

## Why calling Glean `/rest/api/v1/agents/runs/wait` from PMD returns `Status Code: 408`

When an Extend presentation (`.pmd`) page invokes an external AI agent synchronously—such as calling a Glean Agent (`POST /rest/api/v1/agents/runs/wait`) from a `pageActionButton` `onClick` script using a deferred PMD endpoint (`"deferred": true`, `"httpMethod": "POST"`)—the request often succeeds in Postman or on short prompts, but intermittently fails in the Extend UI with:

text

```
An endpoint error has occurred for 'generateGoalsApi' in 'home'
Status Code: 408
Request URL: https://api.glean.com/rest/api/v1/agents/runs/wait
Request Method: POST
```

This happens because Glean’s `/rest/api/v1/agents/runs/wait` endpoint holds the HTTP connection open while the agent retrieves enterprise context and generates its multi-paragraph response (such as drafting annual performance goals from prior objectives). Workday Presentation Components enforce a strict **24-second timeout** on any individual page endpoint (`endPoints` and `outboundEndPoints`), and treat HTTP `408 Request Timeout` as a fatal endpoint error by default.

Adding `"_bestEffort": true` (with a leading underscore) does not prevent the timeout, and even the valid PMD attribute `"bestEffort": true` only suppresses the red page-level crash when a widget fails to render—it does **not** extend the HTTP socket timeout or return the delayed agent response to `generateGoalsApi.invoke()` inside `onClick`. Furthermore, hardcoding a static `Authorization` bearer string and `authType: "noAuth"` directly inside a `.pmd` file exposes credentials in app source code.

## Moving Glean and Sana agent calls into Workday Orchestrate

Whether you are calling a Glean agent (`POST /rest/api/v1/agents/runs/wait`) or triggering a Sana agent via an external REST webhook, move the external HTTP call out of the `.pmd` page and into **Workday Orchestrate**, and store your credentials in the tenant rather than in the PMD:

| Integration Pattern | How It Connects to Workday | Recommended Use Case |
| --- | --- | --- |
|  **Custom Agents in Sana / ASOR A2A** | Custom Agents built in App Builder and activated in **Agent Management Hub** (ASOR) are automatically available inside **Sana** and A2A-ready in `Mode=Delegate` | Conversational interactions initiated by the user inside Sana or the Workday chat panel |
|  **Triggering an External Agent (Glean or Sana REST/Webhook) from an Extend Page** | Extend PMD page invokes a Workday **Orchestration**, which calls the external agent REST API using **Send HTTP Request** and credentials stored in **Create External Client CredStore** (or Orchestration Credentials / Integration Attributes) | Button-driven Extend workflows (such as a **Generate Smart Goals** button on a goal-setting form) |

## Step-by-step: Calling an external agent from Extend without 408 errors

### 1\. Store external API credentials securely in the tenant

Never place a raw `Bearer` string or user identifier inside the `headers` array of a `.pmd` endpoint:

-   **If the external agent platform uses OAuth 2.0 Client Credentials or Authorization Code:** Run the **Create External Client CredStore** task in your Workday tenant (secured to the *Security Administration* domain), configure the client ID, client secret, and token endpoint, and give it an **External Reference ID** (for example, `externalGoalAgentCred`). In Orchestration Builder, open **Settings** > **Credentials** (`Create Orchestration Credentials`) and reference that CredStore entry.
-   **If the external agent endpoint uses a static API bearer credential or webhook key:** Store the credential in an **App Attribute** or **Integration Attribute** configured with masked display, or pass it through an orchestration credential header rather than hardcoding it in PMD JSON.

Also ensure your external agent platform’s firewall allowlists Workday’s regional outbound IP addresses (*Reference: Workday Extend Basic Setup*).

### 2\. Configure the `Send HTTP Request` step in Orchestrate

In Orchestration Builder, create an orchestration that calls the external agent endpoint using the **Send HTTP Request** component:

1.  Set **Method** to `POST` and **URL** to your external agent endpoint (for example, `https://api.glean.com/rest/api/v1/agents/runs/wait` or your Sana agent webhook URL).
2.  On the **Auth** tab, select the credential you configured in **Settings** > **Credentials**.
3.  On the **Headers** tab, add `Content-Type` with value `application/json` (and any required acting-user header populated dynamically from the orchestration’s launch parameters).
4.  On the **Body** tab, select **Create Text Template** with **Content Type** set to `application/json`:
    
    handlebars
    
    ```
    {
      "agent_id": "{{lp.getSimpleData('agentId')}}",
      "input": {
        "Previous year objectives": "{{lp.getSimpleData('priorObjectives')}}",
        "Goal Category I": "{{lp.getSimpleData('goalCategory')}}",
        "Answer to prompt": "{{lp.getSimpleData('promptAnswer')}}"
      }
    }
    ```
    
5.  On the **Settings** tab of the **Send HTTP Request** step, increase **Overall Timeout**, **Connect Timeout**, and **Response Timeout** so the HTTP client waits for the external agent run to finish without cutting off at 10–24 seconds.

### 3\. Choose Synchronous vs. Asynchronous launch based on agent latency

-   **If the external agent consistently finishes in under 20 seconds:** You can expose the orchestration as a **Synchronous Orchestration** and extract the assistant message in Orchestrate before returning it to the PMD page:
    
    javascript
    
    ```
    data.CallExternalAgent.response
      .asJSON()
      .stringAtJsonPath("$.messages[1].content[0].text")
    ```
    
-   **If the external agent frequently takes longer than 20–25 seconds:** Remember that a Synchronous Orchestration triggered from a PMD page still hits the 25-second presentation limit. In that case, use either the external agent’s non-blocking start-run + polling endpoints, or trigger an **Asynchronous Orchestration** that writes the generated goals into an Extend Business Object (`goalSuggestionDraft`) and lets the user click **Refresh Suggestions** on the PMD page once the run completes.

## Verifying the external agent call in your tenant

Trigger the **Generate Smart Goals** action from your Extend page in the tenant and open **Orchestration Activity** on the Developer Site. Select the orchestration run and inspect the **Send HTTP Request** step in the **Summary Report**: confirm that the step returns HTTP `200`, that the response body contains the `messages` array with `role: "GLEAN_AI"` (or your Sana agent output), and that no `408 Request Timeout` occurs on the PMD page.

## Sources checked

-   [endPoints](https://developer.workday.com/documentation/ujr1530565661647)
-   [Call External REST APIs in Extend Apps](https://developer.workday.com/documentation/GUID-10a25b3e-5e1b-4d78-8c5e-b61c331048d2-enHYPHENus)
-   [Create External Client CredStore](https://developer.workday.com/documentation/gqs1527493104452)
-   [Create Orchestration Credentials](https://developer.workday.com/documentation/uwh1613475703138)
-   [Reference: Send HTTP Request](https://developer.workday.com/documentation/GUID-f2e319a1-9fb9-42a2-b4c7-648cfef7380d)

## Related guides

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

-   [### Avoiding the 25-Second Synchronous Timeout When an Extend Page Calls External LLM APIs Through Orchestrate Although Synchronous Orchestrations support up to 5 minutes of execution when called externally, Presentation Components enforce a strict 25-second timeout when a PMD page triggers a Synchronous Orchestration. Refactor multi-step OCR and LLM pipelines to an Asynchronous Orchestration with a BO.](https://kiweely.com/guides/workday-extend-async-orchestration-llm-timeout)
-   [### AI Gateway Document Intelligence (/ml/docint/v1/ids): Converting Workday Drive Base64 to Binary, Resume Layout Pitfalls, and Fixing Opt-In Errors Workday’s Document Intelligence REST APIs (/ml/docint/v1/ids, /doc, and /resume) require raw binary payloads (up to 20 MB) rather than Base64 strings. Learn how to decode Workday Drive Base64 payloads with an explicit MIME type in Orchestrate, handle multi-column resumes, and fix opt-in errors.](https://kiweely.com/guides/workday-document-intelligence-base64-binary-opt-in-errors)
-   [### 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)
-   [### Fixing invalid\_request OAuth Token Exchange Errors When Connecting Microsoft Copilot Studio to Workday A2A Connecting Microsoft Copilot Studio to a Workday Agent over the Agent2Agent (A2A) protocol fails with 400 BadRequest and invalid\_request when the token exchange omits Proof Key for Code Exchange (PKCE) or uses mismatched OAuth endpoints. Align PKCE and your ASOR Delegate skill settings to fix it.](https://kiweely.com/guides/workday-a2a-copilot-studio-oauth-invalid-request)

### More guides on Custom agents and Workday AI

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

-   [Passing Large CSV File Attachments From a Workday Custom Agent Flow to Orchestrate Without Hitting Context Limits](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](https://kiweely.com/guides/workday-custom-agent-duplicate-initiate-change-job)
-   [Why Custom Agent Actions Fail With S22 Permission Denied or Task Not Authorized in Agent Chat](https://kiweely.com/guides/workday-custom-agent-actions-permission-denied-tool-wids)
-   [Why Custom Agent Skills Deployed From the Developer Site Don’t Appear in Agent Management Hub, and ASOR Tenant Prerequisites](https://kiweely.com/guides/workday-agent-management-hub-skills-not-showing)
-   [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)

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

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

-   [Rewriting Your Workday SOW When an AI Agent Builds the Extend App](https://kiweely.com/blog/rewrite-workday-sow-when-ai-builds-extend)
-   [When a Workday Customer Needs an FDE vs Buying AI Agent Seats](https://kiweely.com/blog/workday-fde-vs-buying-ai-agent-seats)
-   [How Flex Credits Change Fixed-Fee Workday Partner Bids](https://kiweely.com/blog/flex-credits-change-fixed-fee-workday-partner-bids)

## 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.
