Skip to content

Commit bfdd519

Browse files
tgilfillanclaude
andcommitted
Add stock-notifications example
Extend app that displays Workday's current stock price on a home page card, backed by an orchestration that fetches the quote from an external API and writes it to a StockInfo business object. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 30edcb8 commit bfdd519

9 files changed

Lines changed: 147 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Stock Notifications
2+
3+
## What it is
4+
5+
An Extend app that shows Workday's current stock price (WDAY) on a home page card. An orchestration calls an external stock quote API, then writes the ticker, price, and timestamp into a Workday business object through the Workday REST API so the card can render the latest value.
6+
7+
## What's inside
8+
9+
- `appManifest.json`, `presentation/` — the Extend app shell (site and app manifest)
10+
- `cards/stockInfo.carddefinition` — the home page card that displays the stock price
11+
- `model/StockInfo.businessobject` and `model/StockSecurityDomain.securitydomain` — the business object that stores the ticker, price, and last-updated fields
12+
- `orchestration/StockRetrieval.orchestration` — fetches the quote from an external API and posts it into the `StockInfo` business object via the Workday API
13+
14+
## How to use it
15+
16+
1. Deploy the app source to your WCP development tenant (App Builder, the IDE plugins, or the WDCLI), then install and launch it.
17+
2. Import `orchestration/StockRetrieval.orchestration` in Orchestration Builder and update the `SendHTTPRequest` node's URL to point at your own stock quote API.
18+
3. The orchestration authenticates to that external API with a Basic Auth credential named `onrender`. Replace the placeholder `YOUR_USERNAME` / `YOUR_PASSWORD` values with your own credential — never commit real ones.
19+
4. Deploy the orchestration to your tenant, then run it (or schedule it) to keep the `StockInfo` record fresh.
20+
5. Launch the app; the `stockInfo` card reads from the `StockInfo` business object and shows the latest price.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "6f4026e444f4f3f37ac1d53d4a63a298",
3+
"referenceId": "stocknotifications_svfbfp",
4+
"name": "StockNotifications",
5+
"description": "",
6+
"latestVersion": "eaa00627e15388b48397b7c8974413f4",
7+
"organizationId": "9ff68ed1-68e4-4225-9f3d-68dbf554c38b"
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"id": "stockInfo",
3+
"presentation": {
4+
"type": "inlineCard",
5+
"header": {
6+
"type": "cardHeader",
7+
"title": "Workday Stock Price",
8+
"subtitle": "current price",
9+
"icon": "wd-accent-chart-bar-arrow"
10+
},
11+
"body": {
12+
"type": "simpleCard",
13+
"value": "My Simple Card Body"
14+
}
15+
}
16+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"title": "Stock Notifications",
3+
"description": "An Extend app that fetches Workday's current stock price from an external API and displays it on a home page card.",
4+
"type": "Extend App",
5+
"components": [
6+
"Presentation",
7+
"Card",
8+
"Model",
9+
"Orchestration"
10+
],
11+
"products": [
12+
"Workday Extend",
13+
"Workday Orchestrate"
14+
],
15+
"authors": [
16+
"tony-gilfillan"
17+
],
18+
"tutorial": "",
19+
"source": "community"
20+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"id": 1,
3+
"name": "StockInfo",
4+
"label": "Stock Info",
5+
"defaultSecurityDomains": [
6+
"StockSecurityDomain"
7+
],
8+
"defaultCollection": {
9+
"name": "stockInfos",
10+
"label": "Stock Infos"
11+
},
12+
"fields": [
13+
{
14+
"id": 1,
15+
"name": "stockTicker",
16+
"type": "TEXT",
17+
"isReferenceId": false,
18+
"useForDisplay": true,
19+
"isPurgeable": false,
20+
"enableIndex": false,
21+
"enableSearch": false
22+
},
23+
{
24+
"id": 2,
25+
"name": "currentPrice",
26+
"type": "TEXT",
27+
"isReferenceId": false,
28+
"useForDisplay": false,
29+
"isPurgeable": false,
30+
"enableIndex": false,
31+
"enableSearch": false
32+
},
33+
{
34+
"id": 3,
35+
"name": "lastUpdated",
36+
"type": "TEXT",
37+
"isReferenceId": false,
38+
"useForDisplay": false,
39+
"isPurgeable": false,
40+
"enableIndex": false,
41+
"enableSearch": false
42+
}
43+
]
44+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": 1,
3+
"name": "StockSecurityDomain",
4+
"enabledForPageSecurity": false,
5+
"enabledForOrchestrationSecurity": false
6+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"flowVersion":"3.2.0","_type":"Flow","_value":{"id":{"_type":"String","_value":"5b8fa91937ce46d7a6ee41f4691099ef"},"name":{"_type":"Identifier","_value":"StockRetrieval"},"type":{"_type":"FlowType","_value":".maya.FlowSync"},"start":{"_type":"StartBasic","_value":{"structuredRequest":{"_type":["Opt","RequestStructure"],"_value":null},"hasMultipartData":{"_type":"Boolean","_value":false},"mcpToolConfig":{"_type":["Opt","MCPToolInputConfig"],"_value":null},"notes":{"_type":["List","Note"],"_value":[]}}},"end":{"_type":"EndSync","_value":{"headers":{"_type":["List","Header"],"_value":[]},"body":{"_type":["Opt","DataRefBody"],"_value":{"_type":"DataRefBody","_value":{"dataRef":{"_type":["Expr","Data"],"_value":{"type":{"_type":"Type","_value":"Data"},"source":{"_type":"String","_value":"data.SendWorkdayAPIRequest.response"},"isAuto":{"_type":"Boolean","_value":false}}},"contentType":{"_type":["Opt","String"],"_value":null}}}},"mcpToolConfig":{"_type":["Opt","MCPToolOutputConfig"],"_value":null},"notes":{"_type":["List","Note"],"_value":[]}}},"nodes":{"_type":["List","Node"],"_value":[{"_type":"SendHttpRequest","_value":{"name":{"_type":"Identifier","_value":"SendHTTPRequest"},"isDisabled":{"_type":"Boolean","_value":false},"errorHandler":{"_type":["Opt","ErrorHandler"],"_value":null},"body":{"_type":["Opt","HttpBody"],"_value":null},"url":{"_type":["Expr","Url"],"_value":{"type":{"_type":"Type","_value":"Url"},"source":{"_type":"String","_value":"\"https://stockinfo-a6k3.onrender.com/api/stock\""},"isAuto":{"_type":"Boolean","_value":false}}},"queryParams":{"_type":["List","QueryParam"],"_value":[]},"method":{"_type":"HttpMethod","_value":"GET"},"headers":{"_type":["List","Header"],"_value":[]},"auth":{"_type":["Opt","ExternalAuthRef"],"_value":{"_type":"ExternalAuthRef","_value":{"resourceName":{"_type":"String","_value":"QnIDDPyQ"}}}},"isChunked":{"_type":"Boolean","_value":false},"connectTimeoutMs":{"_type":"Long","_value":10000},"responseTimeoutMs":{"_type":"Long","_value":20000},"overallTimeoutMs":{"_type":"Long","_value":300000},"retryConfigRef":{"_type":"RetryConfigRef","_value":"2n6B1rWL"},"tlsConfig":{"_type":["Opt","TlsConfig"],"_value":null},"proxyConfig":{"_type":["Opt","ProxyConfig"],"_value":null},"responseType":{"_type":"HttpResponseType","_value":"Any"},"pollingConfigRef":{"_type":["Opt","PollingConfigRef"],"_value":null},"notes":{"_type":["List","Note"],"_value":[]}}},{"_type":"SendWorkdayApiRequest","_value":{"name":{"_type":"Identifier","_value":"SendWorkdayAPIRequest"},"isDisabled":{"_type":"Boolean","_value":false},"errorHandler":{"_type":["Opt","ErrorHandler"],"_value":null},"body":{"_type":["Opt","CreateTextTemplateBody"],"_value":{"_type":"CreateTextTemplateBody","_value":{"message":{"_type":"TextTemplate","_value":"{\n \"stockTicker\": \"WDAY\",\n \"currentPrice\": {{data.SendHTTPRequest.response.asJSON().jsonDataAtJsonPath(\"$.data.c\")}},\n \"lastUpdated\": {{data.SendHTTPRequest.response.asJSON().jsonDataAtJsonPath(\"$.lastUpdated\")}}\n }"},"contentType":{"_type":"String","_value":"application/json"}}}},"path":{"_type":["Expr","String"],"_value":{"type":{"_type":"Type","_value":"String"},"source":{"_type":"String","_value":"\"apps/stocknotifications_svfbfp/v1/stockInfos\""},"isAuto":{"_type":"Boolean","_value":false}}},"queryParams":{"_type":["List","QueryParam"],"_value":[]},"method":{"_type":"HttpMethod","_value":"POST"},"headers":{"_type":["List","Header"],"_value":[]},"auth":{"_type":"WorkdayCredentialRef","_value":{"resourceName":{"_type":"String","_value":"_DEFAULT_WORKDAY_CREDENTIAL"}}},"isChunked":{"_type":"Boolean","_value":false},"connectTimeoutMs":{"_type":"Long","_value":10000},"responseTimeoutMs":{"_type":"Long","_value":20000},"overallTimeoutMs":{"_type":"Long","_value":300000},"retryConfigRef":{"_type":"RetryConfigRef","_value":"_DEFAULT_WORKDAY_RETRY_CONFIG"},"tlsConfig":{"_type":["Opt","TlsConfig"],"_value":null},"proxyConfig":{"_type":["Opt","ProxyConfig"],"_value":null},"responseType":{"_type":"HttpResponseType","_value":"Any"},"longRunningRequest":{"_type":"Boolean","_value":false},"notes":{"_type":["List","Note"],"_value":[]}}}]},"notes":{"_type":["List","Note"],"_value":[]},"resources":{"_type":"ResourceProvider","_value":{"fileLikeResources":{"_type":["Map","Resource"],"_value":{}},"credentials":{"_type":["Map","Credential"],"_value":{"QnIDDPyQ":{"_type":"BasicCredential","_value":{"name":{"_type":"String","_value":"onrender"},"username":{"_type":["Expr","String"],"_value":{"type":{"_type":"Type","_value":"String"},"source":{"_type":"String","_value":"\"YOUR_USERNAME\""},"isAuto":{"_type":"Boolean","_value":false}}},"password":{"_type":["Expr","String"],"_value":{"type":{"_type":"Type","_value":"String"},"source":{"_type":"String","_value":"\"YOUR_PASSWORD\""},"isAuto":{"_type":"Boolean","_value":false}}}}}}},"xmlNamespaces":{"_type":["Map","String"],"_value":{}},"retryConfigs":{"_type":["Map",["WithNotes","RetryConfig"]],"_value":{"2n6B1rWL":{"_type":["WithNotes","RetryConfig"],"_value":{"value":{"_type":"RetryConfig","_value":{"name":{"_type":"String","_value":"OnRender"},"maxTotalRetries":{"_type":"Int","_value":6},"successResponseCodeRanges":{"_type":["List","ResponseCodeRange"],"_value":[]},"defaultBackOff":{"_type":"BackOff","_value":{"intervalMs":{"_type":"Long","_value":10000},"factor":{"_type":"Decimal","_value":1.0},"maxBackOffMs":{"_type":"Long","_value":300000}}},"retryPolicies":{"_type":["List","RetryPolicy"],"_value":[]}}},"notes":{"_type":["List","Note"],"_value":[]}}}}},"csvFormats":{"_type":["Map","CsvFormat"],"_value":{}},"pollingConfigs":{"_type":["Map","PollingConfig"],"_value":{}}}},"defaultWorkdayCredentialRef":{"_type":["Opt","AccessTokenFromInitiatingUser"],"_value":{"_type":"AccessTokenFromInitiatingUser","_value":"AccessTokenFromInitiatingUser"}},"mayaVersion":{"_type":"String","_value":"1.4072.0"},"errorHandler":{"_type":["Opt","ErrorHandler"],"_value":null},"cancelBarrier":{"_type":["Opt","Identifier"],"_value":null},"defaultLocale":{"_type":"Locale","_value":{"value":{"_type":["Expr","String"],"_value":{"type":{"_type":"Type","_value":"String"},"source":{"_type":"String","_value":"\"\"\"en_US\"\"\""},"isAuto":{"_type":"Boolean","_value":false}}}}},"securityDomains":{"_type":["Opt",["List","String"]],"_value":null}}}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"appProperties": [],
3+
"tasks": [
4+
{
5+
"id": "stockInfo",
6+
"routingPattern": "/stockInfo",
7+
"page": {
8+
"id": "stockInfo"
9+
}
10+
}
11+
],
12+
"applicationId": "stocknotifications_svfbfp"
13+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"id": "stocknotifications_svfbfp",
3+
"applicationId": "stocknotifications_svfbfp",
4+
"siteId": "stocknotifications_svfbfp",
5+
"languages": [
6+
{
7+
"code": "en-US",
8+
"description": "English"
9+
}
10+
],
11+
"siteAuth": {
12+
"authTypes": [
13+
{
14+
"scheme": "SSO",
15+
"id": "sso"
16+
}
17+
]
18+
}
19+
}

0 commit comments

Comments
 (0)