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

@agentproto/workflow-mastra

v0.1.3

Published

@agentproto/workflow-mastra — project an AIP-15 WORKFLOW.md's compiled RuntimeWorkflow onto a Mastra `createWorkflow`. Runtime projection (same one-level-up relationship `toMastraTool` has to `implementTool`): tool steps dispatch through the same `runTool

Readme

@agentproto/workflow-mastra

Project an AIP-15 WORKFLOW.md's compiled RuntimeWorkflow onto a Mastra createWorkflow. Runtime projection, not codegen — same one-level-up relationship toMastraTool has to implementTool.

Status: 0.1.0-alpha. Design spec: packages/workflow/README.md §A in this repo's history (PR #672 / this package's PR).

Usage

import { compileWorkflowManifest } from "@agentproto/workflow-runtime"
import { toMastraWorkflow } from "@agentproto/workflow-mastra"

const compiled = compileWorkflowManifest(workflowMdSource, { tools, candidates })
const mastraWorkflow = toMastraWorkflow(compiled, { agents: mySessionHost })

const run = await mastraWorkflow.createRunAsync()
const result = await run.start({ inputData: { chatId: "…" } })

Step-kind mapping

| RunStep.kind | Mastra primitive | |---|---| | tool | createStep({execute}) wrapping the same runTool dispatch the engine itself uses | | transform | createStep({execute}) calling the step's compute selector | | agent | createStep({execute}) delegating to @agentproto/workflow-runtime's own AgentStep executor via a one-step sub-run (reuses the spawn/prompt/policy/outputSchema-retry logic instead of re-implementing it) | | group | one wrapper createStep running the group's children through a local step-walker, so later top-level siblings still see their outputs (matches the engine's shared-bindings model) | | branch | .branch([[cond, thenStep], [negatedCond, elseStep]]) | | parallel | .parallel([...branchSteps]) | | map | .foreach(bodyStep, { concurrency }) | | loop | .dowhile(bodyStep, condition)condition combines LoopStep.while with Mastra's native iterationCount, so maxIterations is enforced without a synthetic counter step | | subworkflow | delegates to runWorkflow for the child (isolated bindings, matching SubworkflowStep's own documented semantics) | | suspend, approval | not projectabletoMastraWorkflow throws WorkflowProjectionError eagerly, before building anything |

pipeline (a workflow-runtime-only fan-out kind not covered by the design spec this package implements) also fails loud rather than silently degrading to map semantics it doesn't have.

Known limitations

  • Composite step bodies (branch/map/loop/group) run through a small local step-walker rather than further Mastra sub-workflows, so a nested body CAN read $input / $item / $index and any sibling bound earlier in the SAME run.
  • parallel branches run concurrently, and Mastra's per-run state has no compare-and-swap — two branches merging into it at once would silently lose one branch's write. So a parallel branch's own nested step ids are visible to LATER steps within the SAME branch, but not to anything outside the parallel block; only the branch's own final output (keyed by branch id, via Mastra's own concurrency-safe result aggregation) binds under the ParallelStep's id.
  • An AgentStep's selectors (delegated to an isolated one-step runWorkflow sub-run for full parity with the engine's own spawn/prompt/policy/retry executor) only see $input, not $steps.<id>.
  • map bodies don't get $index (Mastra's .foreach() doesn't expose the element's index to the body step).

Flagged, not solved here — same spirit as the design spec's own documented gaps (packages/workflow/README.md).

License

Apache-2.0 — see LICENSE.