robomotion

Crates.iorobomotion
lib.rsrobomotion
version0.1.3
created_at2025-12-18 07:20:07.921273+00
updated_at2025-12-18 09:27:52.801967+00
descriptionOfficial Rust SDK for building Robomotion RPA packages
homepagehttps://robomotion.io
repositoryhttps://github.com/robomotionio/robomotion-rust
max_upload_size
id1991886
size398,809
Faik Uygur (faik)

documentation

https://docs.rs/robomotion

README

Robomotion Rust SDK

Official Rust SDK for building Robomotion RPA packages.

Overview

Robomotion is a Robotic Process Automation (RPA) platform that allows you to build automation workflows using visual flow designers. This SDK enables you to create custom nodes (packages) in Rust that can be used within Robomotion flows.

Installation

Add this to your Cargo.toml:

[dependencies]
robomotion = "0.1"
tokio = { version = "1", features = ["full"] }
async-trait = "0.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

Quick Start

1. Create a new node

use robomotion::prelude::*;
use robomotion::message::Context;

#[derive(Node, Default)]
#[node(id = "MyPackage.Hello", name = "Hello", icon = "mdiHand", color = "#3498db")]
pub struct HelloNode {
    #[serde(flatten)]
    pub node: NodeBase,

    #[input(title = "Name", var_type = "string", scope = "Message", name = "name")]
    pub in_name: InVariable<String>,

    #[output(title = "Greeting", var_type = "string", scope = "Message", name = "greeting")]
    pub out_greeting: OutVariable<String>,
}

#[async_trait]
impl MessageHandler for HelloNode {
    async fn on_create(&mut self) -> Result<()> {
        Ok(())
    }

    async fn on_message(&mut self, ctx: &mut Context) -> Result<()> {
        let name = self.in_name.get(ctx).await?;
        self.out_greeting.set(ctx, format!("Hello, {}!", name)).await?;
        Ok(())
    }

    async fn on_close(&mut self) -> Result<()> {
        Ok(())
    }
}

2. Register and start

use robomotion::prelude::*;

mod hello;

#[tokio::main]
async fn main() {
    register_node::<hello::HelloNode>();
    start().await;
}

3. Create config.json

{
  "name": "My Package",
  "namespace": "MyPackage",
  "version": "1.0.0",
  "language": "Rust",
  "platforms": ["linux", "windows", "darwin"]
}

Important: All node IDs must start with the namespace from config.json. If namespace is MyPackage, node IDs must be MyPackage.NodeName.

Features

  • Strongly-typed variables: InVariable<T>, OutVariable<T>, OptVariable<T>
  • Async lifecycle methods: on_create, on_message, on_close
  • Credential/Vault access: Secure access to stored credentials
  • Large Message Objects (LMO): Automatic handling of payloads >256KB
  • AI Tool support: Expose nodes as AI-callable tools
  • OAuth2 support: Browser-based authorization flows
  • Debug mode: Attach mode for rapid development

Variable Types

Type Usage Access
InVariable<T> Required input .get(ctx).await
OptVariable<T> Optional input .get(ctx).await returns Option<T>
OutVariable<T> Output .set(ctx, value).await
Credential Vault access .get(ctx).await returns credentials

Node Attributes

#[derive(Node, Default)]
#[node(
    id = "Namespace.NodeName",  // Must match config.json namespace
    name = "Display Name",
    icon = "mdiIcon",
    color = "#3498db",
    inputs = 1,
    outputs = 1
)]

Documentation

License

MIT License - see LICENSE for details.

Links

Commit count: 0

cargo fmt