{"id":6859,"library":"robocorp","title":"Robocorp","description":"Robocorp provides core Python libraries for robotic process automation (RPA), enabling developers to create and manage automated tasks. It includes modules for task orchestration, work item management, and integration with the Robocorp platform. The current version is 3.1.1, with regular updates typically released multiple times per quarter.","status":"active","version":"3.1.1","language":"en","source_language":"en","source_url":"https://github.com/robocorp/robocorp/","tags":["RPA","automation","robotics","tasks","workitems","robotic process automation"],"install":[{"cmd":"pip install robocorp","lang":"bash","label":"Install Robocorp core libraries"}],"dependencies":[],"imports":[{"note":"As of v2.0.0, the task decorator moved to the `robocorp.tasks` module.","wrong":"from robocorp import task","symbol":"task","correct":"from robocorp.tasks import task"},{"note":"As of v2.0.0, work item management moved to the `robocorp.workitems` module.","wrong":"from robocorp import workitems","symbol":"inputs","correct":"from robocorp.workitems import inputs"},{"note":"Accesses the current output work item.","symbol":"outputs","correct":"from robocorp.workitems import outputs"},{"note":"While `robocorp.browser` (v1.x) is still bundled with `robocorp` v3.x, for the latest browser automation features, users should explicitly install `rpaframework-browser` and import from it.","wrong":"from robocorp.browser import browser","symbol":"page","correct":"from rpaframework.browser import page"}],"quickstart":{"code":"import os\nfrom robocorp.tasks import task\nfrom robocorp.workitems import inputs, outputs\n\n@task\ndef minimal_task():\n    \"\"\"\n    A basic Robocorp task that reads an input and writes an output.\n    \n    To run locally, create a 'work-items/input.json' file in the root of your project\n    with content like: `{\"message\": \"Hello Robocorp!\"}`\n    Then execute with `python -m robocorp.tasks run -t minimal_task`.\n    \"\"\"\n    try:\n        # Access current input work item payload\n        input_payload = inputs.current.payload\n        message = input_payload.get(\"message\", \"No message provided.\")\n        print(f\"Received message: {message}\")\n\n        # Process the message\n        processed_message = f\"Processed by Robocorp: {message.upper()}\"\n\n        # Create an output work item and save processed data\n        output_item = outputs.create()\n        output_item.payload[\"processed_message\"] = processed_message\n        output_item.save()\n\n        print(f\"Wrote output: {processed_message}\")\n\n    except Exception as e:\n        # In a real scenario, you'd handle errors more robustly for Control Room visibility\n        print(f\"Task failed: {e}\")\n        raise # Re-raise to indicate task failure","lang":"python","description":"This quickstart demonstrates creating a simple Robocorp task that reads data from an input work item, processes it, and then writes the result to an output work item. It highlights the core 'task' decorator and 'workitems' modules, which are central to Robocorp automations."},"warnings":[{"fix":"For new projects or updated features, `pip install rpaframework-browser rpaframework-windows` and update imports to `from rpaframework.browser import ...` or `from rpaframework.windows import ...`.","message":"The `robocorp.browser` and `robocorp.windows` modules included directly in the `robocorp` package are frozen at older versions (1.x as of `robocorp` v3.x). For up-to-date and feature-rich browser or Windows automation, you must explicitly install `rpaframework-browser` and `rpaframework-windows` and import from those packages (e.g., `from rpaframework.browser import ...`).","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Update imports to `from robocorp.tasks import task` for task decorators and `from robocorp.workitems import inputs, outputs` for work item management.","message":"Major refactor in v2.0.0 moved primary task and work item functionalities into dedicated sub-packages. Old imports like `from robocorp import task` or `from robocorp import workitems` no longer work.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Create a `work-items` directory in your project root with `input.json` (and optionally `output.json`) files containing sample data. Use `rcc` or `python -m robocorp.tasks run` commands for local execution to ensure the environment is correctly set up.","message":"Robocorp tasks operate within a specific environment, heavily relying on 'work items' for input and output data. When running tasks locally or debugging, ensure you provide valid `work-items/input.json` files to simulate the expected inputs, or tasks might fail attempting to access non-existent data.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Understand the role of each tool in the Robocorp ecosystem. Install `rcc` separately for environment control, and `robocorp-action-server` if you need to create HTTP APIs for your automations.","message":"While `robocorp` is the core Python library, Robocorp's ecosystem includes other critical tools like `rcc` (Robocorp Command Center) for environment management and `Action Server` for exposing automations as APIs. These are separate installations and tools, and the `robocorp` library itself doesn't directly provide their functionality.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}