{"_id":"@alineo-labs/workflow","_rev":"6-85fe8e712836ae7d1d11996ab596baa5","name":"@alineo-labs/workflow","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@alineo-labs/workflow","version":"0.1.0","license":"Apache-2.0","_id":"@alineo-labs/workflow@0.1.0","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"homepage":"https://github.com/DrejT/alineo#readme","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"2880e4fc0f7d4778e29d56b87cb7fcd8c04055f9","tarball":"https://registry.npmjs.org/@alineo-labs/workflow/-/workflow-0.1.0.tgz","fileCount":4,"integrity":"sha512-DN14666b0hO9JajKJarx5QWEXbdiOvZJxzckq3z4uE6Q6cMfA0ZQfhkKBank3qKk83u6yo1lu/nXQgPyZu0eVg==","signatures":[{"sig":"MEUCIBk4J18vIhbGvxm/3yc5Su9ge735oiWDKq1M2LhyBYrUAiEAoFIbcz+skAr4bdwsq45TB/XZM2S2dH2LpJFY+hNueGI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fworkflow@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20909},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"85844a1b5aae067c377cbeb8dd692f3e7c29efa3","scripts":{"test":"vitest run","build":"tsdown","test:watch":"vitest"},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/workflow"},"_npmVersion":"10.9.8","description":"Lazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"alineo":"0.1.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.22.3","vitest":"4.1.9","bun-types":"1.3.14","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/workflow_0.1.0_1786774285937_0.44742520316774614","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@alineo-labs/workflow","version":"0.1.1","license":"Apache-2.0","_id":"@alineo-labs/workflow@0.1.1","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"homepage":"https://github.com/DrejT/alineo#readme","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"aa4f6a66e66cf77afb78371a4091e1a8587b9962","tarball":"https://registry.npmjs.org/@alineo-labs/workflow/-/workflow-0.1.1.tgz","fileCount":4,"integrity":"sha512-xAwETs2Unl1uZDiMLaJETVByaqG8sMKO7Qs6XaYFHum3xzshp0FOhV23guJSpRBzE8HoQlmG1vJefSuWYFaq9Q==","signatures":[{"sig":"MEQCICYTKcPEYH0iTR9Ks4AQ02Fa1ykGqacLNEza/jDiYhazAiAyRqCPchZTL9YwKGWIhlZgkyObvsqod5C4QiA7QCWgnw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fworkflow@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20950},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"68d77069e3789b1d20291f0ba9a21a2c1345d183","scripts":{"test":"vitest run","build":"tsdown","test:watch":"vitest"},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/workflow"},"_npmVersion":"10.9.8","description":"Lazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@alineo-labs/sandbox":"0.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.22.3","vitest":"4.1.9","bun-types":"1.3.14","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/workflow_0.1.1_1787410951564_0.9132192450146968","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@alineo-labs/workflow","version":"0.1.2","license":"Apache-2.0","_id":"@alineo-labs/workflow@0.1.2","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"homepage":"https://github.com/DrejT/alineo#readme","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"81b642e8f754aff38f48a294ad1c023ae197c3b4","tarball":"https://registry.npmjs.org/@alineo-labs/workflow/-/workflow-0.1.2.tgz","fileCount":4,"integrity":"sha512-0oDyCnn5/P8kQTb8F3kyF1XYVExbC8omYeA2mJff2+sdQRWjLwbo1V4q5rOJFzL3Zm33wwDMjXYEKV56cjQFaw==","signatures":[{"sig":"MEYCIQCCHOEHuRXDf4IT6HITMjjHhOKahk6AioXZ/6wlz7jEmgIhAM/8qotw6xGNzWMwIl8/aSOIg4BFF3A8Ik2YuVi8KxUq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fworkflow@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20931},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"8bd54ff750438ee67b032d48e20abfade662099a","scripts":{"test":"vitest run","build":"tsdown","test:watch":"vitest"},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/workflow"},"_npmVersion":"10.9.8","description":"Lazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@alineo-labs/sandbox":"0.3.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.22.3","vitest":"4.1.9","bun-types":"1.3.14","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/workflow_0.1.2_1788102919669_0.6542072990639236","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@alineo-labs/workflow","version":"0.1.3","license":"Apache-2.0","_id":"@alineo-labs/workflow@0.1.3","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"homepage":"https://github.com/DrejT/alineo#readme","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"8c43fc5e63712947fd4111a1b86602b1c98549f7","tarball":"https://registry.npmjs.org/@alineo-labs/workflow/-/workflow-0.1.3.tgz","fileCount":4,"integrity":"sha512-YErcbbWhqH3QxTFALPkAVz4P1tflb+Fr1p1E37P3DyO7ztFLYHBBHeN/NH7xM1n9HEDkVnG3kBMYQxMmpz+5qQ==","signatures":[{"sig":"MEUCIQDfw5Cudze2Cj2L21gtheV8KR4NOZsKxwhrs10uuQYeUgIgUxIjZJRxg70IlcILe4s9+r3q7HRj6z3psTGhstNkEHk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fworkflow@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20931},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"0a4efc6f2b7e9cc4b02acf303b2439788d55907c","scripts":{"test":"vitest run","build":"tsdown","test:watch":"vitest"},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/workflow"},"_npmVersion":"10.9.8","description":"Lazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@alineo-labs/sandbox":"0.4.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.22.3","vitest":"4.1.9","bun-types":"1.3.14","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/workflow_0.1.3_1788628605611_0.291584056564012","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@alineo-labs/workflow","version":"0.1.4","license":"Apache-2.0","_id":"@alineo-labs/workflow@0.1.4","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"homepage":"https://github.com/DrejT/alineo#readme","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"d470fb31bcc154c2ab618bb7de0ee8a0ec7d1c40","tarball":"https://registry.npmjs.org/@alineo-labs/workflow/-/workflow-0.1.4.tgz","fileCount":4,"integrity":"sha512-eHaeruva2hRLlwHD76xlDPV3oaISY845ZdOhiHwmRu0uApI9urpQTLYnTeH1iNl/yOMs9tBrOzHJxSJ/Gfe4Ig==","signatures":[{"sig":"MEUCIEL7SwH0+7vsQ3YQbgETZR5rvcZ2LnfnOPDnr6i4At+VAiEArGE0ryMVQOr9S4I5DoGxAiAQ0bGESey4vGeT/Q1HQkw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fworkflow@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20869},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"d3323f599d24aade22d8e26ed1ae695e1d236280","scripts":{"test":"vitest run","build":"tsdown","test:watch":"vitest"},"_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/workflow"},"_npmVersion":"10.9.8","description":"Lazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@alineo-labs/sandbox":"0.4.1"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.23.0","vitest":"5.0.0","bun-types":"1.4.2","typescript":"6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/workflow_0.1.4_1789325269301_0.04450583741355252","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"_id":"@alineo-labs/workflow@0.1.5","bugs":{"url":"https://github.com/DrejT/alineo/issues"},"dist":{"shasum":"757b54f94b395c0576e7e40fa1b83ceac45d4ec0","tarball":"https://registry.npmjs.org/@alineo-labs/workflow/-/workflow-0.1.5.tgz","fileCount":4,"integrity":"sha512-kgw6dxeYSNCnkyDVy23P7yIALujiyIqppqgeXKHpKAUkyYdENSqf2cK0El16dUtJcX2b65LkqckN2d21yJsu/Q==","signatures":[{"sig":"MEYCIQCQIg5c0yO8MNQ0DcdikUgtMJY6O1rRJH+qopbyXiCg5wIhALVbPWb1YzzGbNsiV9U+tQ7Bn2b6px9ivVfiN/N12HYe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCp54qTMBFA8VthNgPkcsQH0G8BcNi3rBOv9nz8Csv96QIgXZpkds9wngF1r2ttsJ+ha/HJcfEg4XxeP8StQTXdDgo="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alineo-labs%2fworkflow@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20869},"main":"./dist/index.mjs","name":"@alineo-labs/workflow","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"f93158d7a5153f9889db2e32e001b12cba151d6c","license":"Apache-2.0","scripts":{"test":"vitest run","build":"tsdown","test:watch":"vitest"},"version":"0.1.5","_npmUser":{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"},"homepage":"https://github.com/DrejT/alineo#readme","repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/workflow"},"_npmVersion":"10.9.8","description":"Lazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.","directories":{},"maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"_nodeVersion":"22.23.2","dependencies":{"@alineo-labs/sandbox":"0.4.2"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"0.23.0","vitest":"5.0.0","bun-types":"1.4.2","typescript":"6.0.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/workflow_0.1.5_1789538501202_0.1014328213934701"}}},"time":{"created":"2026-08-15T06:11:25.745Z","modified":"2026-09-16T06:01:41.750Z","0.1.0":"2026-08-15T06:11:26.072Z","0.1.1":"2026-08-22T15:02:31.717Z","0.1.2":"2026-08-30T15:15:19.949Z","0.1.3":"2026-09-05T17:16:45.733Z","0.1.4":"2026-09-13T18:47:49.444Z","0.1.5":"2026-09-16T06:01:41.301Z"},"bugs":{"url":"https://github.com/DrejT/alineo/issues"},"license":"Apache-2.0","homepage":"https://github.com/DrejT/alineo#readme","repository":{"url":"git+https://github.com/DrejT/alineo.git","type":"git","directory":"packages/workflow"},"description":"Lazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.","maintainers":[{"name":"drejtoolwell","email":"vivekpatel4049@gmail.com"}],"readme":"# @alineo-labs/workflow\n\nLazy pipeline builder for [alineo](https://alineo.tech) — retry, conditional branching, fan-out, and parallel sandboxes, all flushed in one `await`.\n\n```bash\nbun add @alineo-labs/workflow\n```\n\n**[Full documentation →](https://docs.alineo.tech/docs/workflow)**\n\n---\n\n## How it works\n\n`workflow(client).sandbox(opts, fn)` returns a builder. The `fn` callback receives a `SandboxBuilder` — all methods on it queue operations synchronously. Nothing runs until you `await .pipe()` or `.result()`.\n\n```ts\nimport { workflow } from \"@alineo-labs/workflow\";\n\nawait workflow(client)\n  .sandbox({ image: \"node:20-slim\", resources: { cpu: \"1\", memory: \"512Mi\" } }, (sb) => {\n    sb.exec(\"npm ci\");\n    sb.exec(\"npm run build\");\n    sb.exec(\"npm test\");\n  })\n  .pipe(process.stdout);\n```\n\n---\n\n## Retry\n\n```ts\nsb.retry(\n  3,\n  (r) => {\n    r.exec(\"flaky-network-call\");\n  },\n  { delayMs: 500, backoff: \"exponential\" },\n);\n```\n\n## Conditional branching\n\nThe predicate receives `{ stdout, exitCode, vars }` from the previous step.\n\n```ts\nsb.exec(\"test -f /app/build.sh\", { strict: false });\nsb.when(\n  (ctx) => ctx.exitCode === 0,\n  (s) => s.exec(\"bash /app/build.sh\"),\n  (s) => s.exec(\"echo 'no build script'\"),\n);\n```\n\n## Fan-out\n\n```ts\nsb.forEach(\n  [\"a.ts\", \"b.ts\", \"c.ts\"],\n  (s, file) => {\n    s.exec(`tsc --noEmit ${file}`);\n  },\n  { concurrency: 4 },\n);\n```\n\n## Capture a value\n\n`sb.readFile(path, as)` stores file contents in `vars[as]` on the result object.\n\n```ts\nconst { vars } = await workflow(client)\n  .sandbox({ image: \"node:20-slim\", resources: { cpu: \"500m\", memory: \"256Mi\" } }, (sb) => {\n    sb.exec(`node -e \"require('fs').writeFileSync('/out.txt', process.version)\"`);\n    sb.readFile(\"/out.txt\", \"nodeVersion\");\n  })\n  .result();\n\nconsole.log(vars.nodeVersion); // \"v20.x.x\"\n```\n\n## Parallel sandboxes\n\nRun the same builder across multiple configs simultaneously:\n\n```ts\nawait workflow(client)\n  .parallel(\n    [\n      { image: \"node:18-slim\", resources: { cpu: \"500m\", memory: \"256Mi\" } },\n      { image: \"node:20-slim\", resources: { cpu: \"500m\", memory: \"256Mi\" } },\n      { image: \"node:22-slim\", resources: { cpu: \"500m\", memory: \"256Mi\" } },\n    ],\n    (sb) => {\n      sb.exec(\"node --version\");\n      sb.exec(\"npm ci && npm test\");\n    },\n  )\n  .pipe(process.stdout);\n```\n\n## Sequential pipeline\n\nPass work across sandboxes in order, each starting fresh:\n\n```ts\nawait workflow(client)\n  .sequence([\n    {\n      image: \"node:20-slim\",\n      resources: { cpu: \"1\", memory: \"512Mi\" },\n      run: (sb) => {\n        sb.exec(\"npm ci\");\n        sb.exec(\"npm run build\");\n      },\n    },\n    {\n      image: \"alpine:3\",\n      resources: { cpu: \"500m\", memory: \"256Mi\" },\n      run: (sb) => {\n        sb.exec(\"ls /app/dist\");\n      },\n    },\n  ])\n  .pipe(process.stdout);\n```\n\n---\n\n## License\n\nApache 2.0\n","readmeFilename":"README.md"}