{"id":7682,"library":"robocorp-workitems","title":"Robocorp Work Items","description":"The `robocorp-workitems` library is part of the Robocorp ecosystem, providing utilities to manage data flow between tasks in a Robotic Process Automation (RPA) workflow. It allows robots to read input work items and write output work items, facilitating the transfer of structured data, files, and assets. The current version is 1.5.0, and it's actively maintained as part of the broader Robocorp platform.","status":"active","version":"1.5.0","language":"python","source_language":"en","source_url":"https://github.com/robocorp/robocorp/tree/master/packages/workitems","tags":["robocorp","rpa","automation","work-items","workflow","data-exchange"],"install":[{"cmd":"pip install robocorp-workitems","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"wrong":"from robocorp.workitems import current","symbol":"current","correct":"from robocorp.workitems import current"}],"quickstart":{"code":"from robocorp.tasks import task\nfrom robocorp.workitems import inputs, outputs\n\n@task\ndef process_data():\n    # Read current input work item's payload\n    input_item = inputs.current\n    if input_item.get_payload('my_key'):\n        data = input_item.get_payload('my_key')\n        print(f\"Received data: {data}\")\n    else:\n        print(\"No 'my_key' found in input payload. Using default.\")\n        data = {\"message\": \"Hello from robot!\"}\n\n    # Create an output work item\n    output_item = outputs.create()\n    # Add a payload to the output work item\n    output_item.set_payload({\"status\": \"processed\", \"original_data\": data})\n    # You can also add files\n    # output_item.add_file('path/to/my_file.txt')\n    # Save the output work item\n    output_item.save()\n\n    print(\"Output work item created and saved.\")","lang":"python","description":"This quickstart demonstrates how to read data from an input work item and create an output work item with a new payload. It's designed to run within the Robocorp environment or locally with simulated work item data."},"warnings":[{"fix":"Replace `from RPA.Robocorp.WorkItems import WorkItems` with `from robocorp.workitems import current, inputs, outputs`. Re-implement logic using the new, idiomatic API.","message":"The `robocorp-workitems` library is the modern replacement for the older `RPA.Robocorp.WorkItems` from the `rpaframework`. Direct migration is needed as the API has changed significantly.","severity":"breaking","affected_versions":"All `robocorp-workitems` versions when migrating from `rpaframework`."},{"fix":"Always run your robot using `rc task run` for local development or within Robocorp Control Room for production. For local testing, simulate input work items by creating a `devdata/work-items-in` directory with `work-item.json` files.","message":"The `robocorp.workitems.current` object (and `inputs.current`, `outputs.create()`) relies on a Robocorp execution environment. When running a Python script directly without `rc task run` or a properly configured `devdata` folder, `current` might be `None` or operations might fail.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Ensure all data placed into `set_payload` or `add_payload` consists of standard Python types (dict, list, string, number, boolean, None) that can be directly converted to JSON.","message":"Payloads for work items must be JSON serializable. Attempting to add non-serializable objects (e.g., custom class instances, datetime objects without conversion) directly to the payload will result in a serialization error.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"search_vec":"'1.5.0':56 'activ':60 'allow':31 'asset':51 'autom':27,71 'broader':66 'current':53 'data':19,48,77 'data-exchang':76 'ecosystem':14 'exchang':78 'facilit':43 'file':49 'flow':20 'input':35 'item':3,37,42,74 'librari':8 'maintain':61 'manag':18 'output':40 'part':10,63 'platform':68 'process':26 'provid':15 'read':34 'robocorp':1,6,13,67,69 'robocorp-workitem':5 'robot':25,32 'rpa':28,70 'structur':47 'task':22 'transfer':45 'util':16 'version':54 'work':2,36,41,73 'work-item':72 'workflow':29,75 'workitem':7 'write':39","created_at":"2026-04-16T14:08:51.948617+00:00","updated_at":"2026-04-16T14:08:51.948617+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'current' from 'robocorp.workitems' (/tmp/tmpvo68irn7/venv/lib/python3.12/site-packages/robocorp/workitems/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.5.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://robocorp.com","github":"https://github.com/robocorp/robocorp","docs":null,"changelog":null,"pypi":"https://pypi.org/project/robocorp-workitems/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["workflow","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}