robocorp-workitems


Namerobocorp-workitems JSON
Version 1.4.6 PyPI version JSON
download
home_pagehttps://github.com/robocorp/robocorp/
SummaryRobocorp Work Items library
upload_time2024-09-26 12:06:36
maintainerNone
docs_urlNone
authorFabio Z.
requires_python<4.0,>=3.9
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # robocorp-workitems

Work items are used in Robocorp Control Room for managing data that go through multiple steps and tasks inside a process. Each step of a process receives input work items from the previous step, and creates output work items for the next step.

## Getting started

The library exposes two objects, `inputs` and `outputs`, which are the main way to interact with work item queues. The former deals with the reading input work items, and the latter with creating output work items.

A run inside Control Room will always have at least one work item available to it. The simplest Robot which reads the current work item and creates an output can be done in the following manner:

```python
from robocorp import workitems
from robocorp.tasks import task

@task
def handle_item():
    item = workitems.inputs.current
    print("Received payload:", item.payload)
    workitems.outputs.create(payload={"key": "value"})
```

Iterating over all available input items in the queue is also easy:

```python
from robocorp import workitems
from robocorp.tasks import task

@task
def handle_all_items():
    for item in workitems.inputs:
        print("Received payload:", item.payload)
        workitems.outputs.create(payload={"key": "value"})
```

### Work item structure

A work item's data payload is JSON and allows storing anything that is JSON serializable. By default, the payload is a mapping of key-value pairs.

In addition to the payload section, a work item can also contain files, which are stored within Robocorp Control Room. Adding and using files with work items requires no additional setup from the user.

## Guides

- [Reserving and releasing input items](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/00-reserving-inputs.md)
- [Creating outputs](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/01-creating-outputs.md)
- [Local development](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/02-local-development.md)
- [Email triggering](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/03-email-triggering.md)
- [Collecting all inputs](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/04-collecting-inputs.md)
- [Flow control with exceptions](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/05-input-exceptions.md)
- [Modifying inputs](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/06-modifying-inputs.md)

Further user guides and tutorials can be found in [Robocorp Docs](https://robocorp.com/docs).

## API Reference

Explore our [API](https://github.com/robocorp/robocorp/blob/master/workitems/docs/api/README.md) for extensive documentation.

## Changelog

A list of releases and corresponding changes can be found in the [changelog](https://github.com/robocorp/robocorp/blob/master/workitems/docs/CHANGELOG.md).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/robocorp/robocorp/",
    "name": "robocorp-workitems",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Fabio Z.",
    "author_email": "fabio@robocorp.com",
    "download_url": "https://files.pythonhosted.org/packages/c1/e0/35eea484bb2727ded657a88703ee51e89cf1e1a709fb33b78d3a88b4f3d3/robocorp_workitems-1.4.6.tar.gz",
    "platform": null,
    "description": "# robocorp-workitems\n\nWork items are used in Robocorp Control Room for managing data that go through multiple steps and tasks inside a process. Each step of a process receives input work items from the previous step, and creates output work items for the next step.\n\n## Getting started\n\nThe library exposes two objects, `inputs` and `outputs`, which are the main way to interact with work item queues. The former deals with the reading input work items, and the latter with creating output work items.\n\nA run inside Control Room will always have at least one work item available to it. The simplest Robot which reads the current work item and creates an output can be done in the following manner:\n\n```python\nfrom robocorp import workitems\nfrom robocorp.tasks import task\n\n@task\ndef handle_item():\n    item = workitems.inputs.current\n    print(\"Received payload:\", item.payload)\n    workitems.outputs.create(payload={\"key\": \"value\"})\n```\n\nIterating over all available input items in the queue is also easy:\n\n```python\nfrom robocorp import workitems\nfrom robocorp.tasks import task\n\n@task\ndef handle_all_items():\n    for item in workitems.inputs:\n        print(\"Received payload:\", item.payload)\n        workitems.outputs.create(payload={\"key\": \"value\"})\n```\n\n### Work item structure\n\nA work item's data payload is JSON and allows storing anything that is JSON serializable. By default, the payload is a mapping of key-value pairs.\n\nIn addition to the payload section, a work item can also contain files, which are stored within Robocorp Control Room. Adding and using files with work items requires no additional setup from the user.\n\n## Guides\n\n- [Reserving and releasing input items](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/00-reserving-inputs.md)\n- [Creating outputs](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/01-creating-outputs.md)\n- [Local development](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/02-local-development.md)\n- [Email triggering](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/03-email-triggering.md)\n- [Collecting all inputs](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/04-collecting-inputs.md)\n- [Flow control with exceptions](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/05-input-exceptions.md)\n- [Modifying inputs](https://github.com/robocorp/robocorp/blob/master/workitems/docs/guides/06-modifying-inputs.md)\n\nFurther user guides and tutorials can be found in [Robocorp Docs](https://robocorp.com/docs).\n\n## API Reference\n\nExplore our [API](https://github.com/robocorp/robocorp/blob/master/workitems/docs/api/README.md) for extensive documentation.\n\n## Changelog\n\nA list of releases and corresponding changes can be found in the [changelog](https://github.com/robocorp/robocorp/blob/master/workitems/docs/CHANGELOG.md).\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Robocorp Work Items library",
    "version": "1.4.6",
    "project_urls": {
        "Homepage": "https://github.com/robocorp/robocorp/",
        "Repository": "https://github.com/robocorp/robocorp/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0540c53608d8d56196349783eef06e6f851da3b4cb1a641180d1af68303280e",
                "md5": "62d8ef207c8e85f61dd1e46311d0fb2b",
                "sha256": "a06483df3cee43ebc0c668c9eaa06fdea75acc6bf8d6a7aad069e286360f9852"
            },
            "downloads": -1,
            "filename": "robocorp_workitems-1.4.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "62d8ef207c8e85f61dd1e46311d0fb2b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 21780,
            "upload_time": "2024-09-26T12:06:35",
            "upload_time_iso_8601": "2024-09-26T12:06:35.592366Z",
            "url": "https://files.pythonhosted.org/packages/c0/54/0c53608d8d56196349783eef06e6f851da3b4cb1a641180d1af68303280e/robocorp_workitems-1.4.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c1e035eea484bb2727ded657a88703ee51e89cf1e1a709fb33b78d3a88b4f3d3",
                "md5": "b4fbe5d1c2a0db43838119c5e4fbb4a0",
                "sha256": "37d2c8c22262df313cf68694d015ebcd976f1f8b5ffdfcb5eb64492825e4d576"
            },
            "downloads": -1,
            "filename": "robocorp_workitems-1.4.6.tar.gz",
            "has_sig": false,
            "md5_digest": "b4fbe5d1c2a0db43838119c5e4fbb4a0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 17809,
            "upload_time": "2024-09-26T12:06:36",
            "upload_time_iso_8601": "2024-09-26T12:06:36.843662Z",
            "url": "https://files.pythonhosted.org/packages/c1/e0/35eea484bb2727ded657a88703ee51e89cf1e1a709fb33b78d3a88b4f3d3/robocorp_workitems-1.4.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-26 12:06:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "robocorp",
    "github_project": "robocorp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "robocorp-workitems"
}
        
Elapsed time: 0.48506s