{"record":{"id":"e58fe4bc29a5598e","repo":"n8n-io/n8n","slug":"no-serializer-registered-for-format-format-p","errorCode":null,"errorMessage":"No serializer registered for format '${format}'. Provide a registry with serializers when creating the workflow.","messagePattern":"No serializer registered for format '(.+?)'\\. Provide a registry with serializers when creating the workflow\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder.ts","lineNumber":765,"sourceCode":"\t\t\t\t\t\tissue.nodeName,\n\t\t\t\t\t\tissue.parameterPath,\n\t\t\t\t\t\tissue.originalName,\n\t\t\t\t\t\tissue.violationLevel,\n\t\t\t\t\t\tissue.severity === 'informational' ? 'informational' : 'warning',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn JSON.stringify(this.toJSON(), null, 2);\n\t}\n\n\ttoFormat<T>(format: string): T {\n\t\tconst registry = this._registry;\n\t\tif (!registry) {\n\t\t\tthrow new Error(\n\t\t\t\t`No serializer registered for format '${format}'. Provide a registry with serializers when creating the workflow.`,\n\t\t\t);\n\t\t}\n\t\tconst serializer = registry.getSerializer(format);\n\t\tif (!serializer) {\n\t\t\tthrow new Error(`No serializer registered for format '${format}'`);\n\t\t}\n\n\t\tconst ctx: SerializerContext = {\n\t\t\tnodes: this._nodes,\n\t\t\tworkflowId: this.id,\n\t\t\tworkflowName: this.name,\n\t\t\tsettings: this._settings,\n\t\t\tpinData: this._pinData,\n\t\t\tmeta: this._meta,\n\t\t\tresolveTargetNodeName: (target: unknown) => this.resolveTargetNodeName(target),\n\t\t};\n","sourceCodeStart":747,"sourceCodeEnd":783,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder.ts#L747-L783","documentation":"toFormat(format) serializes a built workflow using a plugin registry. The registry is optional — it is only attached when the workflow is created via createWorkflow with a WorkflowBuilderOptions carrying a registry, or when default plugins register serializers. If the builder instance has no registry at all, toFormat() cannot proceed and throws this error pointing the caller to supply a registry at construction time.","triggerScenarios":"Constructing a WorkflowBuilderImpl directly without a registry (or via a path that omits the registry argument), then calling .toFormat('json') or any other format. Also when fromJSON() creates a builder — it passes undefined as the registry.","commonSituations":"Using the lower-level WorkflowBuilderImpl constructor directly instead of the workflow() factory; importing a workflow via fromJSON() and then trying toFormat(); custom integrations that build the impl manually.","solutions":["Create the workflow via the workflow() factory and pass { registry: myRegistry } as the options argument.","If using fromJSON(), the imported builder has no registry — use .toJSON() instead, or re-create via workflow() with a registry to use toFormat().","Ensure registerDefaultPlugins has run (it runs on module load) so the default jsonSerializer is available through the global pluginRegistry."],"exampleFix":"// before\nconst wf = workflow.fromJSON(json);\nwf.toFormat('json'); // throws — no registry\n\n// after\nconst wf = workflow('id', 'name', { registry: pluginRegistry });\nwf.add(trigger({})).to(node({ type: 'Set' }));\nwf.toFormat('json');","handlingStrategy":"validation","validationCode":"import { pluginRegistry } from 'workflow-sdk';\n\nfunction hasRegistry(wf: any): boolean {\n  return wf._registry != null; // or expose a public getter\n}\nif (!hasRegistry(wf)) {\n  // re-create with a registry, or use toJSON() instead of toFormat()\n}","typeGuard":"function hasRegistry(wf: { toFormat(format: string): unknown }): boolean {\n  // Probe by checking the public surface; the cleanest check is whether\n  // the workflow was created via workflow() with a registry option.\n  return Boolean((wf as any)._registry);\n}","tryCatchPattern":"try {\n  return wf.toFormat('json');\n} catch (e) {\n  if (e instanceof Error && /No serializer registered/.test(e.message)) {\n    return wf.toJSON(); // fall back to plain JSON\n  }\n  throw e;\n}","preventionTips":["Create workflows via the workflow() factory and pass { registry: pluginRegistry } when you need toFormat().","Prefer .toJSON() unless you specifically need a pluggable serializer.","Do not call toFormat() on builders produced by fromJSON(); they have no registry."],"tags":["workflow-builder","serialization","registry","plugins"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}