My first Python step
A step type is a manifest plus code. The Python SDK uses only the standard library and runs the step on your machine the same way an agent does, with no core.
-
Create the skeleton.
Janela do terminal python -m automatrpa new greet --name acme.greet -
Write the logic in
greet/main.py:from automatrpa.step import StepContext, TransientError, maindef handle(ctx: StepContext) -> dict[str, object]:name = ctx.inputs["name"]ctx.log("building the greeting", attempt=ctx.attempt_number)if not name:raise TransientError("empty name")return {"message": f"Hello, {name}!"}if __name__ == "__main__":main(handle)TransientErrorasks for another attempt;PermanentErroror any other exception is a permanent failure. -
Run it locally.
Janela do terminal python -m automatrpa run greet --inputs greet/inputs.json -
Check it against the catalog and publish it (development environment only):
Janela do terminal automatrpa catalog export --out catalog.jsonpython -m automatrpa check greet --catalog catalog.jsonautomatrpa step-type publish greet
More in the step development guide.