Framework lifecycle
ServiceGenerated.run / ServiceRuntimeTypeScript lifecycle
Promise makers, runtime component categories, startup rollback, task admission, and bounded stop.
When to use
Use this page when implementing maker hooks, owning resources, or diagnosing startup and shutdown.
Behavior
- Default maker objects exist before
customMakersInit. initInfrastructureandinitFunctionsParallelcreate long-lived instances before bindings.ServiceRuntimevalidates topology, starts managed connector cores and downstream categories, callsstartAdmissionbefore DataSources, and starts HTTP last.- The runner passes
serviceConfig.shutdownTimeoutintoapp.stop.
TypeScript startup sequence
ConfigurationLoad graph configResolve typed service, stream, connector, and endpoint settings.
FactoriesdefaultMakersInstall defaults, then run
customMakersInit, customFunctionsInit, and onStart.ConstructionInvoke makers onceCreate infrastructure and long-lived functions in parallel.
BindingBuild graph and endpointsBind streams, callers, endpoint consumers, functions, and transport routes.
Connector coreOpen clientsStart managed connector clients before anything can submit or poll.
DownstreamStart graph resourcesStart storage, pools, components, and Sinks before inbound work.
Worker admissionStart managed pollingOpen Temporal or other connector-owned inbound workers after Sinks are ready.
SourcesStart DataSourcesOpen ordinary graph admission only after every downstream dependency is ready.
ServersStart listenersOpen generated HTTP and gRPC listeners after endpoint bindings and graph resources are ready.
TypeScript shutdown sequence
SignalStop requestedCreate one deadline from
shutdownTimeout.NetworkClose listenersReject new HTTP/gRPC requests and drain accepted handlers while graph dependencies remain alive.
SourcesDrain root workStop ordinary DataSources and admission-aware components.
WorkersStop managed admissionStop connector-owned polling only after ordinary Sources have drained.
ProducersPools, timers, storageStop admission and drain tasks that can still create graph work.
GraphParallelCall registryDrain only after no producer can create another child.
OutputStop DataSinksFlush results and accepted outbound submissions.
Connector coreClose clientsRelease managed connector clients after Sources, graph work, and Sinks no longer need them.
ReleaseRelease graph ownershipDrop endpoint consumers, streams, functions, and bindings only after their callbacks cannot run.
TelemetryFlush diagnosticsMetrics, traces, and logs cover shutdown and stop at the final safe boundary.
- Stopping during startup aborts startup and waits for reverse-order rollback.
stopAdmissioncloses DataSource, Component, and HTTP admission together; resources without a separate admission API are stopped in that phase.- Admission-aware DataSources then drain before managed connector admission stops.
- Storage, DelayPool, TaskPool, and PriorityTaskPool stop before
RuntimeTaskRegistry.drain. - The registry closes task admission after the producer phase and cancels on drain failure.
- DataSinks, managed connector cores, and telemetry then stop in ordered groups.
Startup rollback
On component start failure, already-started components stop in reverse order with startup cancellation removed. The original startup error is preserved.
Hooks and boundaries properties
Generated extension points and runtime-owned lifecycle boundaries.
PropertyTypeDescription
customMakersInituser hookReplaces maker fields before invocation.
initFunctionsParallelgeneratedRuns independent makers as Promises.
ServiceRuntime.registerconstructionRegisters lifecycle objects only before start.
START_ORDERruntime contractTelemetry, managed connector cores, storage, pools, Components, Sinks, managed admission, DataSources, HTTP.
RuntimeTaskRegistrydrain boundaryTracks nested work and closes task admission.
Lifecycle outline
configure -> make once -> bind -> start -> admit -> drain -> stop