Merged
Size
XL
Change Breakdown
Feature85%
Maintenance10%
Docs5%
#28015feat: Add agent schema introspection (no-changelog)

Agents can now be serialized to JSON and rebuilt

Agents can now be serialized to JSON and rebuilt

Agents built with the SDK can now be dehydrated into JSON and reconstructed later, with a new credential provider that resolves API keys by name rather than embedding them in code.

Agents built with the SDK can now be serialized to JSON and reconstructed later. A new describe() method exports a complete agent configuration as a schema object, while fromSchema() reconstructs a fully functional agent from that schema. This rounds out the agent lifecycle: build fluently, export the config, store it, and rebuild anywhere.

The credential provider solves the problem of embedding raw API keys in agent code. Instead of passing secret keys directly, developers can reference a credential by name or ID. The provider resolves these references at build time, keeping credentials out of source code and enabling proper secret management.

A companion feature generates TypeScript code from any agent schema. This closes the loop between visual editing, JSON storage, and code generation — agents can be designed in a UI, serialized, and converted back to portable code.

In the agents SDK, these changes wire together serialization, reconstruction, and sandboxed execution through new types including AgentSchema, CredentialProvider, and HandlerExecutor. The agent itself gains a builder interface that avoids circular dependencies between the main class and reconstruction logic.

View Original GitHub Description

Summary

PR changes:

  • added agent config introspection that allows dehydrating agent into a single json config and then reconstructing it from the config
  • added credential provider that allows using credential names instead of raw secret keys

Related Linear tickets, Github issues, and Community forum posts

<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/ --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->

Review / Merge checklist

  • PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
  • Docs updated or follow-up ticket created.
  • Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)
© 2026 · via Gitpulse