npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

automa-trigger

v1.0.0

Published

A library to trigger Automa workflows.

Downloads

2

Readme

Automa Trigger Library

A lightweight, standalone Node.js library for triggering local Automa workflows directly from backend applications.

This package handles temporary data file generation, constructs the correct Automa trigger URL, and invokes the workflow using an included helper script.


Features

  • Trigger Automa workflows with a single function call.
  • Pass structured data to the workflow via a temporary or custom JSON file.
  • Automatically manages file path creation if none is provided.
  • Returns the data file path used, making tracking and logging easy.
  • Bundled with a openMinimized.ahk script to launch the browser in a minimized state.

Installation

This package is intended for use in a pnpm workspace. Ensure your pnpm-workspace.yaml is configured, then install it with:

pnpm add automa-trigger@workspace:* -w

Usage

Import the triggerWorkflow function and call it with the necessary options and your payload:

import { triggerWorkflow } from 'automa-trigger';
import path from 'path';

async function runWorkflow() {
  const options = {
    triggerUrl: 'automa://<your-workflow-id>',
    extensionId: 'your-automa-extension-id',
    workflowId: 'your-workflow-id',
    websiteName: 'My Awesome App',
    browser: 'chrome' as const, // or 'edge'
    filePath: path.join(__dirname, '..', 'data', 'workflow-input.json'), // optional
  };

  const payload = {
    userId: 123,
    task: 'process-data',
    details: {
      source: 'api-request',
    },
  };

  try {
    const fileUsed = await triggerWorkflow(options, payload);
    console.log(`Workflow triggered. Data file saved at: ${fileUsed}`);
  } catch (err) {
    console.error('Failed to trigger workflow:', err);
  }
}

runWorkflow();

API

triggerWorkflow(options, data)

Triggers an Automa workflow and returns a Promise<string> containing the full path to the JSON data file used.

Parameters

  • options: TriggerOptions – Required configuration for the workflow trigger.
  • data: object – A JSON-serializable object to be passed to the workflow.

TriggerOptions Interface

| Property | Type | Required | Description | | ------------- | -------------------- | -------- | ----------------------------------------------------------------------------------- | | triggerUrl | string | Yes | The URL to trigger the Automa workflow (e.g., automa://...). | | extensionId | string | Yes | Automa browser extension ID. | | workflowId | string | Yes | The ID of the workflow to run. | | websiteName | string | Yes | Name of the app or service initiating the trigger. | | browser | 'chrome' \| 'edge' | Yes | Browser in which to open the workflow. | | filePath | string | No | Optional absolute file path for the data file. Defaults to a temporary system path. |


How It Works

  1. File Path Resolution: Uses a custom filePath if provided; otherwise, generates one in the OS's temp directory.
  2. Data File Creation: Serializes the input data to JSON and writes it to the chosen path, creating necessary directories.
  3. URL Construction: Compresses and embeds the file path and parameters into the trigger URL.
  4. Workflow Invocation: Uses the internal openMinimized.ahk script to launch the browser minimized and open the URL.
  5. Path Return: Resolves with the path to the created JSON file.

Development

To build from source:

cd automa-trigger
pnpm install
pnpm build

This will compile TypeScript to the dist directory and copy over the .ahk script.


Requirements