Venolio

Add-ons: extension points

For developers

Besides function (run by an administrator), an entry point can be one of four extension points. Each runs in the same sandbox with the same host API and limits. They differ in who starts them, what input Venolio passes and whose access bounds the run.

Kind Started by Input (SDK type) Output Run source
function An administrator (Run in the add-on’s settings) Your own type Any JSON manual
action A step of an automation ActionInput<T>: {input, trigger} Any JSON (kept with the job when up to 16 KiB) automation
webhook A request to its secret address WebhookInput: {webhook: {id, entry_point, headers, body, json, received_at}} The HTTP response body; null answers {"ok": true} webhook
panel, block A person viewing a page UiInput<C, V>: {surface, event, page_id, teamspace_id, now, config, value} Html { html } for render; any JSON for message ui

The types are in venolio_addon::extension. Administrators can still run any entry point by hand; such a run passes the input unchanged.

Actions

An action is a step people can add to an automation.

use venolio_addon::extension::ActionInput;
use venolio_addon::{entry_point, Result, Value};

#[derive(serde::Deserialize, Default)]
struct Step { channel: String }

fn post(input: ActionInput<Step>) -> Result<Value> {
    // input.input: what the automation step configured (up to 16 KiB)
    // input.trigger: the event that started the automation, or null
    Ok(venolio_addon::json!({"posted_to": input.input.channel, "event": input.trigger}))
}
entry_point!(post);
  • The run acts for the automation’s owner: it never reads or writes more than they can.
  • The event of an add-on trigger is {"addon_id", "trigger", "payload"}; record events carry the database, record and person IDs.
  • A failed or uncertain run fails the automation’s job; Venolio does not retry it.
  • Runs started by automations cannot fire triggers, so automations cannot loop.

Triggers

Declare events in the manifest’s triggers, together with the automations:trigger permission, then fire them from any entry point that an automation did not start:

let started = venolio_addon::triggers::fire("deal_won", &json!({"deal": "Acme Studio", "amount": 1200}))?;

fire returns how many automation jobs were queued (the local stand-in host always says 0). At most 4 fires per run (the fifth stops the run with call_limit_exceeded), with payloads up to 16 KiB. Only administrators can subscribe automations to add-on triggers.

Webhooks

An administrator creates the secret address in the add-on’s settings, under Webhooks, one per webhook entry point. Making a new address invalidates the old one at once. Every request to it runs the entry point:

use venolio_addon::extension::WebhookInput;

fn receive(input: WebhookInput) -> Result<Value> {
    let request = input.webhook;
    let signature = request.header("X-Hub-Signature-256");   // case-insensitive
    let event = request.json.clone();                         // the body parsed as JSON, if it is
    let fields = request.form();                              // or form-encoded pairs
    // request.received_at: when Venolio received it (the sandbox has no clock)
    Ok(json!({"ok": true}))
}
  • The run acts for nobody: only the grants and the granting administrator bound it.
  • Check the sender’s own signature in the add-on (Slack’s X-Slack-Signature, for example): the secret address is the first line of defence, not the only one.
  • Bodies are UTF-8 text up to 64 KiB. Authorization, Cookie, X-Venolio-Token and the caller’s address headers are never passed on; at most 30 headers of up to 1 KiB each.
  • A failed run answers 502. Each address takes 60 requests a minute, then answers 429.

Panels and blocks

panel entry points appear in a page’s info panel; block entry points are page blocks that people add from the / menu. Both run for the person viewing the page.

use venolio_addon::extension::{escape_html, Html, UiEvent, UiInput};

fn panel(input: UiInput) -> Result<Value> {
    match input.event {
        UiEvent::Render => Ok(json!(Html::new(format!(
            "<p>{}</p><button onclick=\"venolio.call({{}}).then(r => alert(r.n))\">Count</button>",
            escape_html("Hello")
        )))),
        UiEvent::Message => Ok(json!({"n": 1})),   // answers venolio.call(value)
    }
}
  • input.teamspace_id is the page’s teamspace (its nearest teamspace; None for pages outside every teamspace). Offer content only where an administrator mapped it. input.now is the server’s time (RFC 3339, UTC); input.now_unix() and extension::{date_from_unix, unix_from_date} turn it into numbers and dates.

  • The HTML runs in a sandboxed frame that allows scripts but has no network, no cookies and no access to Venolio’s page. Inline scripts and styles, and data: images and fonts, work.

  • The frame’s venolio object: venolio.context (surface, page_id, config, theme, locale, can_configure), venolio.call(value), venolio.resize(height), venolio.openUrl(url) and, in blocks the viewer can edit, venolio.setConfig(object) (settings up to 4 KiB, passed back as config).

  • Links: the frame cannot open them itself. Call venolio.openUrl(url) from a click handler. Venolio opens absolute https: addresses (no credentials, up to 2048 characters) in a new tab, only right after a click or key press; the promise rejects otherwise.

    button.onclick = () => venolio.openUrl('https://example.com/folders/' + id)
      .catch((error) => showError(error.message));
    
  • A render that returns no html string fails with The add-on returned no HTML to show.

  • Use theme and locale from venolio.context to follow light and dark mode and the viewer’s language.

Test extension points locally

venolio-addon test and venolio-addon run build the input Venolio passes for the entry point’s kind and record the run’s source, so an add-on sees on your machine what it sees in Venolio:

[
  { "entry_point": "post", "input": { "channel": "C0123" }, "trigger": { "record_id": "…" } },
  { "entry_point": "receive",
    "webhook": { "headers": { "Content-Type": "application/json" }, "body": { "event": "ping" },
                 "received_at": "2026-11-20T10:00:00Z" } },
  { "entry_point": "panel", "ui": { "event": "render", "page_id": "…", "teamspace_id": "…",
                                    "now": "2026-11-20T10:00:00Z", "config": {} },
    "expect": { "html_includes": ["Hello"] } },
  { "entry_point": "panel", "manual": true, "input": { "anything": "as an administrator's run" } }
]
venolio-addon run post --input '{"channel": "C0123"}' --trigger '{"record_id": "r1"}'
venolio-addon run receive --header 'Content-Type: application/json' --body '{"event": "ping"}'
venolio-addon run panel --event message --page-id <uuid> --teamspace-id <uuid> --value '{"n": 1}'

In native tests, MockHost::set_source(Source::Automation) (or Webhook, Ui) makes the stand-in host apply the same rules. venolio-addon new --kind action|webhook|panel|block creates a working starting point for each kind.

About this part of Venolio: Let Claude, ChatGPT and Codex work in your workspace

Checked against the app on . The same help is built into the Venolio apps and works offline. Something wrong or missing? Tell us.