Write a Crossplane Composition using pipeline mode with function-go-templating to generate conditional managed resources based on composite resource spec fields
Define the Composition with mode: Pipeline and list function steps, starting with a function-go-templating step that receives the composite resource as input
Author the Go template that inspects spec fields and conditionally renders one or more managed resource manifests, using range and if constructs to handle optional sub-resources
Add a function-patch-and-transform step after the template step if additional patching of the rendered resources is required, referencing the outputs from the previous step
Configure the ProviderConfig reference within the template output so each managed resource targets the correct provider credentials
Test the pipeline locally using the Crossplane CLI render command with a sample composite resource input before applying to the cluster
Known gotchas
Go template syntax errors inside a Composition function step produce a generic reconciliation error without the specific template line number; test templates with the CLI render command to get useful error output
Pipeline mode Compositions do not support the legacy patches and resources fields; mixing old-style fields with pipeline mode causes a validation error at apply time
The function-go-templating function receives a specific input structure; accessing fields outside the expected path returns an empty string rather than an error, causing silently missing fields in output resources
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp