Polyglot Development (Node/TypeScript, Python & PHP) ​
Build TPF applications in Node/TypeScript, Python, or PHP without re-implementing TPF's execution shell and without installing a JDK, Maven, or Docker for local development.
TPF executes every polyglot pipeline on one Java execution engine paired with thin foreign function hosts and a standalone native tpf CLI. Your TypeScript, Python, or PHP code implements pure typed business functions and, when needed, provider-specific custom Connector adapters. TPF owns graph sequencing, streaming backpressure, deterministic split/merge lineage, retries, telemetry, durable Await suspension and resume, Command reconciliation, and Query capture/replay.
How the boundary works ​
Every polyglot application starts from the same canonical v3 pipeline.yaml contract:
- Canonical types are the authority: Types declared under
types:compile intoMETA-INF/pipeline/pipeline-contract.jsonand thin language bindings (types.ts/host.tsfor TypeScript,types.py/host.pyfor Python,types.php/host.phpfor PHP). - Exact numeric precision across languages:
int64anddecimalvalues never pass through IEEE-754 floating-point conversions. TypeScript mapsint64tobigintanddecimalto exact strings serialised viaJSON.rawJSON(Node 22+); Python mapsint64tointanddecimaltodecimal.Decimal; PHP (64-bit, 8.2+) mapsint64to native 64-bitintanddecimalto exact base-10 strings serialised directly as raw JSON number tokens. - All four cardinalities are supported:
ONE_TO_ONE,ONE_TO_MANY,MANY_TO_ONE, and full-duplexMANY_TO_MANYstreams execute over authenticated HTTP/1.1 using canonical JSON and newline-delimited JSON (NDJSON) with explicit completion sentinels. - Strict secret isolation: Pure business functions never receive provider credentials, resolved connections, or durable stores. Credentials belong to the host engine (Tier 1) or are delivered selectively to authenticated custom Connector hosts (Tier 2).
Example canonical pipeline.yaml ​
version: 3
appName: "Invoice Pipeline"
basePackage: "com.example.invoices"
transport: "LOCAL"
platform: "COMPUTE"
types:
Invoice:
fields:
- name: invoiceId
type: string
- name: sequenceNumber
type: int64
- name: amount
type: decimal
LineItem:
fields:
- name: sku
type: string
- name: lineTotal
type: decimal
InvoiceSummary:
fields:
- name: invoiceId
type: string
- name: grandTotal
type: decimal
steps:
- name: "Validate Invoice"
cardinality: "ONE_TO_ONE"
input: "Invoice"
output: "Invoice"
- name: "Expand Lines"
cardinality: "ONE_TO_MANY"
input: "Invoice"
output: "LineItem"
- name: "Enrich Lines"
cardinality: "MANY_TO_MANY"
input: "LineItem"
output: "LineItem"
- name: "Summarise Invoice"
cardinality: "MANY_TO_ONE"
input: "LineItem"
output: "InvoiceSummary"Reading order ​
- Node and TypeScript — generate stubs, author unary/streaming handlers and Tier-2 custom Connectors, and run with Node 22.18+.
- Python — generate dataclasses and host stubs, author unary/streaming handlers and Tier-2 custom Connectors, and preserve
Decimalprecision. - PHP — generate
final readonlyvalue classes and a zero-dependency PHP 8.2+ Fiber host with exactint64and decimal fidelity. - Spring Boot Integration — expose ordinary Spring Boot
@Servicebeans and Tier-2 Connectors over ADR-0092 withpipelineframework-spring-host-starter(ADR-0094). - Local Development and Testing without a JVM — use
tpf generateandtpf dev, unit-test handlers natively, and verify crash recovery acrossSIGKILL. - Deploying Polyglot Applications — run the Quarkus execution engine alongside remote TLS + HMAC Node, Python, PHP, and Spring Boot foreign hosts and DynamoDB stores.
For the architectural rationale and ownership invariants behind this design, see ADR-0092 and ADR-0094.