Code

Node catalog Scripts
On this page

Run custom Rust code

Usage and specifics

Source can be inline, Git or a workspace. Code runs through the container runtime on the selected target. The image, dependencies and repository access must be available on that target.

Technical type : script_rust. Runtime : docker.

Credentials and prerequisites

This node defines no dedicated external credential. Remote sources or execution targets may still need their own access credentials.

See the credentials guide if a remote source or execution target requires access.

Parameters

Names below are technical keys. Defaults are not a ready-to-run configuration: complete fields required by your operation. Paths containing [] describe list items; some fields depend on the selected mode.

Parameter Type Default Values / limits
libraryIds array - -; max 100
source union {"kind":"inline","script":"use serde_json::{json, Map, Value};\n\npub fn run(input: Value) -> Map<String, Value> {\n let trigger_input = input.get(\"input\").cloned().unwrap_or(json!({}));\n let upstream = input.get(\"nodes\").cloned().unwrap_or(json!({}));\n // API_TOKEN comes from a selected Secret variables credential.\n let api_token = std::env::var(\"API_TOKEN\").unwrap_or_default();\n let mut out = Map::new();\n out.insert(\"payload\".into(), trigger_input);\n out.insert(\"upstream\".into(), upstream);\n out.insert(\"hasApiToken\".into(), json!(!api_token.is_empty()));\n out.insert(\"message\".into(), json!(\"Script output ready\"));\n out\n}\n","dependencies":[]} -
source.files record - -
source.directories array - -; max 100
source.kind literal "inline" inline, git, workspace
source.script string "use serde_json::{json, Map, Value};\n\npub fn run(input: Value) -> Map<String, Value> {\n let trigger_input = input.get(\"input\").cloned().unwrap_or(json!({}));\n let upstream = input.get(\"nodes\").cloned().unwrap_or(json!({}));\n // API_TOKEN comes from a selected Secret variables credential.\n let api_token = std::env::var(\"API_TOKEN\").unwrap_or_default();\n let mut out = Map::new();\n out.insert(\"payload\".into(), trigger_input);\n out.insert(\"upstream\".into(), upstream);\n out.insert(\"hasApiToken\".into(), json!(!api_token.is_empty()));\n out.insert(\"message\".into(), json!(\"Script output ready\"));\n out\n}\n" -
source.dependencies array [] -
source.repo string - -; min 1
source.branch string "main" -; min 1
source.scriptPath string - -; min 1
source.credentialId string - -
source.installRoot string - -
source.installCommand string - -
source.workingDir string - -
image string - -
workspaceSource union - -
workspaceSource.kind literal - upstream, node
workspaceSource.key string - -; min 1
executionTarget union {"kind":"host"} -
executionTarget.kind literal "host" aws_ecs, aws_lambda, gcp_job, gcp_function, azure_container, azure_function, scaleway_job, scaleway_function, scaleway_container, digitalocean_function, host, remote_server, kube, swarm
executionTarget.credentialId string - -; min 1, max 512
executionTarget.storageCredentialId string - -; min 1, max 512
executionTarget.bucket string - -
executionTarget.region string - fr-par, nl-ams, pl-waw; max 64
executionTarget.cluster string - -; min 1, max 512
executionTarget.taskDefinition string - -; min 1, max 512
executionTarget.containerName string - -; max 100
executionTarget.subnets array - -; min 1, max 16
executionTarget.securityGroups array [] -; max 5
executionTarget.assignPublicIp boolean false -
executionTarget.functionName string - -; min 1, max 256
executionTarget.project string - -; max 100
executionTarget.jobName string - -; max 100
executionTarget.endpoint string - -; max 512
executionTarget.subscriptionId string - -
executionTarget.resourceGroup string - -; max 90
executionTarget.functionApp string - -; max 100
executionTarget.jobId string - -
executionTarget.functionId string - -
executionTarget.containerId string - -
executionTarget.namespaceId string - -
executionTarget.serverId string - -; min 1
executionTarget.provider enum - aws, gcp, scaleway, ovh, azure, digitalocean, hetzner
executionTarget.clusterId string - -; min 1
executionTarget.namespace string - -
secretCredentialIds array [] -

Configuration help

image
Container image
Image used to run the script (e.g. docker.io/library/node:22-bookworm). Use localhost/name:tag for a local Podman image.
secretCredentialIds
Secrets
Secrets connections injected as environment variables of the script (process.env, os.environ...). The file carrying them is deleted as soon as the container starts.

Initial configuration

Initial catalog configuration example, to adapt before running. Keep secrets in credentials.

json
{
  "source": {
    "kind": "inline",
    "script": "use serde_json::{json, Map, Value};\n\npub fn run(input: Value) -> Map<String, Value> {\n    let trigger_input = input.get(\"input\").cloned().unwrap_or(json!({}));\n    let upstream = input.get(\"nodes\").cloned().unwrap_or(json!({}));\n    // API_TOKEN comes from a selected Secret variables credential.\n    let api_token = std::env::var(\"API_TOKEN\").unwrap_or_default();\n    let mut out = Map::new();\n    out.insert(\"payload\".into(), trigger_input);\n    out.insert(\"upstream\".into(), upstream);\n    out.insert(\"hasApiToken\".into(), json!(!api_token.is_empty()));\n    out.insert(\"message\".into(), json!(\"Script output ready\"));\n    out\n}\n",
    "dependencies": []
  },
  "executionTarget": {
    "kind": "host"
  }
}

Verification

Test with representative data. Check node output in the inspector and logs, then use editor mapping for downstream fields. A trigger test with a simulated payload does not validate external service delivery.

See also : Expressions and data, Executions, Node catalog.