Robocorp Work Items library
Project description
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:
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:
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
- Creating outputs
- Local development
- Email triggering
- Collecting all inputs
- Flow control with exceptions
- Modifying inputs
Further user guides and tutorials can be found in Robocorp Docs.
API Reference
Information on specific functions or classes: robocorp.workitems
Changelog
A list of releases and corresponding changes can be found in the changelog.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for robocorp_workitems-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 417960a892ee8a1af1b712463e17b2c137333ea21a8c4a50960ca9019a74b5b4 |
|
MD5 | 81111973af3b3ee5750a5bbf402164bc |
|
BLAKE2b-256 | 3b703cebb62ce8789af58cb63878e0a2b01c7a1e3edc513f2953a3858dfe3962 |