{"id":19607137,"url":"https://github.com/robocorp/example-web-store-work-items","last_synced_at":"2025-08-26T00:21:05.147Z","repository":{"id":45634659,"uuid":"394915193","full_name":"robocorp/example-web-store-work-items","owner":"robocorp","description":"An example robot of creating multiple output work items in a process.","archived":false,"fork":false,"pushed_at":"2024-02-19T13:03:26.000Z","size":106,"stargazers_count":5,"open_issues_count":0,"forks_count":9,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-27T19:46:19.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/robocorp.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-08-11T08:15:27.000Z","updated_at":"2024-02-19T13:02:55.000Z","dependencies_parsed_at":"2024-02-19T14:27:49.167Z","dependency_job_id":null,"html_url":"https://github.com/robocorp/example-web-store-work-items","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robocorp/example-web-store-work-items","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-web-store-work-items","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-web-store-work-items/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-web-store-work-items/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-web-store-work-items/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robocorp","download_url":"https://codeload.github.com/robocorp/example-web-store-work-items/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robocorp%2Fexample-web-store-work-items/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272150914,"owners_count":24882253,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T10:09:03.506Z","updated_at":"2025-08-26T00:21:05.063Z","avatar_url":"https://github.com/robocorp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web store order processor: multiple work items example\n\n\u003cimg src=\"images/work-data-management.png\" style=\"margin-bottom:20px\"\u003e\n\nThis robot splits orders by customer from an incoming Excel file. The orders are then handled individually and in parallel. It includes a second version of the consumer task which produces errors, which can be used to demonstrate how the Control Room receives errors from bots.\n\nThe robot demonstrates the Work Items feature of Robocorp Control Room:\n\n- Triggering a process with custom payloads (input)\n- Passing data and files between process steps\n- Parallel execution of steps\n- Robot and Control Room [exception handling](https://robocorp.com/docs/development-guide/control-room/work-items#work-item-exception-handling)\n\n\u003e We recommended checking out the article \"[Using work items](https://robocorp.com/docs/development-guide/control-room/data-pipeline)\" before diving in.\n\n## Tasks\n\nThe robot is split into two tasks, meant to run as separate steps. The first task generates (produces) data, and the second one reads (consumes) and processes that data. A bonus task exists which can be used to mock Control Room and Robot error handling.\n\n\u003e [Producer-consumer](https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem), Wikipedia.\n\n### The first task (the producer)\n\n- Reads an Excel file from the work item\n- Splits it into orders by customer\n- Creates a new work item for each order\n\n### The second task (the consumer)\n\n- Logs in to the web store\n- Reads the products in the order from the work item\n  - Loops through work items to avoid time spent logging in per each work item.\n- Orders the products\n\n### The bonus task (error mocking)\n\n- Produces errors during the same actions as the consumer.\n  - Some error will be retried by the bot internally.\n  - Some errors will cause the run to fail after work items are already released (therefore the work item will still complete).\n  - Some errors will be reported at the Control Room level with appropriate codes and messages.\n- You can automatically retry errors with the [Retry Bot in the Portal](https://robocorp.com/portal/robot/robocorp/example-retry-work-item-bot).\n\n## Excel input file\n\nThe first task expects an [Excel file](https://github.com/robocorp/example-web-store-work-items/raw/master/devdata/work-items-in/split-orders-file-test-input/orders.xlsx) in a specific format:\n\n| Name          | Item                     | Zip  |\n| ------------- | ------------------------ | ---- |\n| Sol Heaton    | Sauce Labs Bolt T-Shirt  | 3695 |\n| Gregg Arroyo  | Sauce Labs Onesie        | 4418 |\n| Zoya Roche    | Sauce Labs Bolt T-Shirt  | 3013 |\n| Gregg Arroyo  | Sauce Labs Bolt T-Shirt  | 4418 |\n| Camden Martin | Sauce Labs Bolt T-Shirt  | 1196 |\n| Zoya Roche    | Sauce Labs Fleece Jacket | 3013 |\n| Zoya Roche    | Sauce Labs Onesie        | 3013 |\n| Sol Heaton    | Sauce Labs Fleece Jacket | 3695 |\n| Sol Heaton    | Sauce Labs Onesee        | 3695 |\n\nBut, you can run this as a demo by supplying no item to the Control Room. The robot will use the default input used in testing and linked above.\n\n## Local development\n\nWhen running in **Control Room**, the work items will be automatically managed and passed between steps in the process. However, when running locally, the work items can be simulated using folder structure and JSON files.\n\n### VsCode\n\n[Robocorp VsCode extensions](https://robocorp.com/docs/developer-tools/visual-studio-code/overview) has built-in support making the use and testing of work items more straightforward.\n\nUsing VsCode, you should only need [this guide](https://robocorp.com/docs/developer-tools/visual-studio-code/extension-features#using-work-items)\n\n### RCC from CLI\n\nAs each task in the robot expects different work item input, we need a way to control this.\n\nThis example includes test inputs, one for each task in the process:\n\n- For task `Split orders file`:\n  - `./devdata/work-items-in/split-orders-file-test-input/work-items.json`\n- For task `Load and Process All Orders`:\n  - `./devdata/work-items-in/process-orders-test-from-outputs/work-items.json`\n\nTo run specific tasks with specific inputs in the command-line you can run the following commands:\n\n- Run `Split orders file` with test input:\n  - `rcc task run -t \"Split orders file\" -e ./devdata/env-split-orders.json`\n- Run `Load and Process All Orders` with test input:\n  - `rcc task run -t \"Load and Process All Orders\" -e ./devdata/env-process-orders.json`\n\n## Control room setup\n\nTo see how to set up Control Room and understand more about how work items are used, see the following article: [Using work items](https://robocorp.com/docs/development-guide/control-room/data-pipeline).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-web-store-work-items","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobocorp%2Fexample-web-store-work-items","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobocorp%2Fexample-web-store-work-items/lists"}