{"id":16170634,"url":"https://github.com/alanfriedman/workday","last_synced_at":"2025-04-07T07:30:16.196Z","repository":{"id":51667026,"uuid":"223810511","full_name":"alanfriedman/workday","owner":"alanfriedman","description":"Workday scripts","archived":false,"fork":false,"pushed_at":"2021-05-10T19:55:19.000Z","size":28,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T11:45:13.357Z","etag":null,"topics":["org-chart","organization","organization-chart","workday","workday-api"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alanfriedman.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-24T21:09:39.000Z","updated_at":"2022-09-22T02:25:56.000Z","dependencies_parsed_at":"2022-08-22T23:51:09.521Z","dependency_job_id":null,"html_url":"https://github.com/alanfriedman/workday","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanfriedman%2Fworkday","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanfriedman%2Fworkday/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanfriedman%2Fworkday/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alanfriedman%2Fworkday/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alanfriedman","download_url":"https://codeload.github.com/alanfriedman/workday/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247611475,"owners_count":20966540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["org-chart","organization","organization-chart","workday","workday-api"],"created_at":"2024-10-10T03:19:15.723Z","updated_at":"2025-04-07T07:30:16.170Z","avatar_url":"https://github.com/alanfriedman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workday Scripts\n\n## get-org\n\nModels the entire organization a tree and saves to JSON file. Includes name, title, location and email of each person.\n\n### Setup\n\nCopy `.env.example` to `.env`\n\n1. Open developer tools to the Network tab.\n2. Sign in to Workday and navigate to the graphical Org Chart view.\n3. 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\n4. Scroll to the top node of the org tree. This should be the CEO/President/Founder of the company.\n5. 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`\n6. Inspect the request and find the Form Data that was sent. Copy the values to your `.env` file, mapping as follows:\n- navigable-instance-iid =\u003e ROOT_NODE_ID\n- navigable-instance-did =\u003e ROOT_NODE_NAME\n- initial-step =\u003e INITIAL_STEP_ID\n- sessionSecureToken =\u003e SECURE_SESSION_TOKEN\n- navigable-instance-set-id =\u003e INITIAL_STEP_ID\n7. Copy the `Cookie` request header to your `.env` file and name it `COOKIE`\n\nStart Redis on localhost port 6379\n\n```\nredis-server\n```\n\n### Run\n\nThis 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.\n\n```\nnode get-org\n```\n\n### Traverse\n\nAfter 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.\n\n```\nnode get-org/traverse.js\n```\n\nProcess each node using the `handleNode` function.\n\n### Example JSON output\n\n```\n{\n  \"id\": \"123$4567\",\n  \"name\": \"Jennifer Doe\",\n  \"location\": \"123 Sesame St\",\n  \"title\": \"VP, Marketing\",\n  \"personId\": \"123$4567\",\n  \"email\": \"jenniferdoe@acme.org\",\n  \"children\": [\n    {\n      \"id\": \"123$4567\",\n      \"name\": \"Michael Doe\",\n      \"location\": \"123 Sesame St\",\n      \"title\": \"Director, Marketing\",\n      \"personId\": \"123$4567\",\n      \"email\": \"michaeldoe@acme.org\",\n      \"children\": [\n        {\n          \"id\": \"123$4567\",\n          \"name\": \"Jim Doe\",\n          \"location\": \"123 Sesame St\",\n          \"title\": \"Senior Manager, Marketing\",\n          \"personId\": \"123$4567\",\n          \"email\": \"jimdoe@acme.org\",\n          \"children\": [\n            {\n              \"id\": \"123$4567\",\n              \"name\": \"Matt Doe\",\n              \"location\": \"123 Sesame St\",\n              \"title\": \"Manager, Marketing\",\n              \"personId\": \"123$4567\",\n              \"email\": \"mattdoe@acme.org\",\n              \"children\": []\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanfriedman%2Fworkday","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falanfriedman%2Fworkday","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falanfriedman%2Fworkday/lists"}