Registry / gcp / ts2workflows

ts2workflows

JSON →
library0.15.0jsnpmunverified

ts2workflows is a transpiler that converts TypeScript code into GCP Workflows YAML programs, enabling type-safe workflow development. Current version is 0.15.0. It supports a subset of TypeScript features, includes type annotations for Workflows standard library and connectors, and provides CLI for batch compilation. Key differentiators: enables type-checking of workflow sources with tsc, integrates with TypeScript ecosystem, and produces self-contained YAML with subworkflows via --link. Requires Node >=20 and TypeScript >=5.5.4 <6.0.

npm install ts2workflows
INSTALL
IMPORT
SIG · TS2WORKFLOWS
T
ts2workflows
gcpjavascriptv0.15.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transpile
import { transpile } from 'ts2workflows'
const transpile = require('ts2workflows'); transpile()
ESM-only import; transpile() is the main API function
http
import { http } from 'ts2workflows/types/workflowslib'
import { http } from 'ts2workflows'
Type annotations for Workflows standard library are exported from a subpath
retry_policy
import { retry_policy } from 'ts2workflows/types/workflowslib'
import retry_policy from 'ts2workflows'
Named export from the types subpath

Shows a basic workflow function with HTTP call and transpilation command.

// sample.ts - a simple workflow import { http, retry_policy } from 'ts2workflows/types/workflowslib'; async function myWorkflow(input: { name: string }) { const result = await http.get(`https://api.example.com/greet?name=${input.name}`); return result.body; } // Transpile using CLI: // npx ts2workflows sample.ts
ts2workflows --version
Debug
Known issues
breakingRequires Node >=20, TypeScript >=5.5.4 <6.0.0
fix
Upgrade Node and TypeScript to compatible versions
affects: >=0.15.0
gotchaOnly a subset of TypeScript features are supported; see language reference for details. Unsupported features may cause transpilation errors or silent omission.
fix
Review language_reference.md before writing workflows
affects: >=0.0.0
gotchaWithout --link flag, only subworkflows from the input file are emitted; main workflow code is not included in output.
fix
Use --link flag to generate self-contained YAML with all subworkflows
affects: >=0.0.0
gotcha--link requires --project argument
fix
Always provide --project when using --link
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ts2workflows/types/workflowslib'
Missing import path or package not installed
fix
npm install ts2workflows and use correct import path: 'ts2workflows/types/workflowslib'
TypeError: transpile is not a function
Using CommonJS require incorrectly
fix
Use ESM import: import { transpile } from 'ts2workflows'
Unsupported syntax: ...
Using unsupported TypeScript feature (e.g., generators, decorators)
fix
Rewrite using supported syntax per language_reference.md
Upgrade
Version history
0.15.0latest on npm
Audit
Dependencies
typescriptoptionalPeer dependency for transpilation and type-checking workflows
Agent activity
42 hits · last 30 days
node
36
OpenAI (training)
2
Resources
ts2workflows — npm install ts2workflows · libregistry