Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alanfriedman/workday
Workday scripts
https://github.com/alanfriedman/workday
org-chart organization organization-chart workday workday-api
Last synced: 14 days ago
JSON representation
Workday scripts
- Host: GitHub
- URL: https://github.com/alanfriedman/workday
- Owner: alanfriedman
- Created: 2019-11-24T21:09:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-10T19:55:19.000Z (over 3 years ago)
- Last Synced: 2024-11-09T14:02:25.295Z (about 2 months ago)
- Topics: org-chart, organization, organization-chart, workday, workday-api
- Language: JavaScript
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Workday Scripts
## get-org
Models the entire organization a tree and saves to JSON file. Includes name, title, location and email of each person.
### Setup
Copy `.env.example` to `.env`
1. Open developer tools to the Network tab.
2. Sign in to Workday and navigate to the graphical Org Chart view.
3. The URL should look like this: `https://www.myworkday.com/ORG_NAME/d/inst/ID_1/rel-task/ID_2.htmld`. Copy ORG_NAME from the URL into your `.env` file
4. Scroll to the top node of the org tree. This should be the CEO/President/Founder of the company.
5. Filter Network requests for `navigable`. You should see a POST request to a URL that looks like this: `https://www.myworkday.com/ORG_NAME/navigable/ID.htmld`
6. Inspect the request and find the Form Data that was sent. Copy the values to your `.env` file, mapping as follows:
- navigable-instance-iid => ROOT_NODE_ID
- navigable-instance-did => ROOT_NODE_NAME
- initial-step => INITIAL_STEP_ID
- sessionSecureToken => SECURE_SESSION_TOKEN
- navigable-instance-set-id => INITIAL_STEP_ID
7. Copy the `Cookie` request header to your `.env` file and name it `COOKIE`Start Redis on localhost port 6379
```
redis-server
```### Run
This will write a JSON tree representation to disk at `get-org/data/tree.json`. The first run could take several minutes, depending on the size of your organization. You can exit the process and restart anytime.
```
node get-org
```### Traverse
After generating the `tree.json` file, you can perform a breadth-first search of the tree to filter the data or otherwise make use of it.
```
node get-org/traverse.js
```Process each node using the `handleNode` function.
### Example JSON output
```
{
"id": "123$4567",
"name": "Jennifer Doe",
"location": "123 Sesame St",
"title": "VP, Marketing",
"personId": "123$4567",
"email": "[email protected]",
"children": [
{
"id": "123$4567",
"name": "Michael Doe",
"location": "123 Sesame St",
"title": "Director, Marketing",
"personId": "123$4567",
"email": "[email protected]",
"children": [
{
"id": "123$4567",
"name": "Jim Doe",
"location": "123 Sesame St",
"title": "Senior Manager, Marketing",
"personId": "123$4567",
"email": "[email protected]",
"children": [
{
"id": "123$4567",
"name": "Matt Doe",
"location": "123 Sesame St",
"title": "Manager, Marketing",
"personId": "123$4567",
"email": "[email protected]",
"children": []
}
]
}
]
}
]
}
```