npx skills add ...
npx skills add pulumi/agent-skills --skill pulumi-automation-api
Load this skill when a user asks how to run Pulumi programmatically, embed Pulumi in an application, orchestrate multiple stacks in code, build a self-service infrastructure portal, replace pulumi CLI shell scripts with code, or use the Pulumi Automation API (LocalWorkspace, createOrSelectStack, inline programs). Also load for questions about multi-stack sequencing, parallel deployments, or passing outputs between stacks via code.
npx skills add pulumi/agent-skills --skill pulumi-automation-api
Invoke this skill when:
Automation API provides programmatic access to Pulumi operations. Instead of running pulumi up from the CLI, you call functions in your code that perform the same operations.
Multi-stack orchestration:
When you split infrastructure into multiple focused projects, Automation API helps offset the added complexity by orchestrating operations across stacks:
Automation API ensures correct sequencing without manual intervention.
Self-service platforms:
Build internal tools where developers request infrastructure without learning Pulumi:
Embedded infrastructure:
Applications that provision their own infrastructure:
Replacing fragile scripts:
If you have Bash scripts or Makefiles stitching together multiple pulumi commands, Automation API provides:
Local Source - Pulumi program in separate files:
When to use:
Inline Source - Pulumi program embedded in orchestrator:
When to use:
The Automation API program can use a different language than the Pulumi programs it orchestrates:
This enables platform teams to use their preferred language while application teams use theirs.
Deploy multiple stacks in dependency order:
Set stack configuration programmatically:
Access stack outputs after deployment:
Handle deployment failures gracefully:
When stacks are independent, deploy in parallel:
Externalize configuration into files or environment variables:
This enables distributing compiled binaries without exposing source code.
Use onOutput callback for real-time feedback:
| Scenario | Approach |
|---|---|
| Existing Pulumi projects | Local source with workDir |
| New embedded infrastructure | Inline source with program function |
| Different teams | Local source for independence |
| Compiled binary distribution | Inline source or bundled local |
| Multi-stack dependencies | Sequential deployment in order |
| Independent stacks | Parallel deployment with Promise.all |