Generate strongly typed interfaces from your SuprSend JSON schemas to catch payload errors at compile time when triggering workflows from your backend code.
Type generation automatically creates strongly typed programming language interfaces from your SuprSend JSON schemas. Instead of manually writing type definitions, you define your workflow payload structure once as a JSON schema in SuprSend, and the CLI generates type-safe interfaces for TypeScript, Python, Go, Java, Kotlin, Swift, or Dart.This ensures payloads sent to workflows always match the expected schema, catching errors at compile time instead of at runtime.
Generated type files are auto-generated and should not be manually edited. Regenerate types when you update schemas in SuprSend.
Without type generation, you work with plain objects that can lead to runtime errors. Type generation catches these errors during development with compile-time type safety and IDE autocomplete.
// ❌ Without types - bug may show up only at runtimeconst data1 = { invoice_amount: "5000" };const total1 = data1.invoice_amount + 500; // "5000500" (string concat)// ✅ With generated types - error caught during developmenttype OrderCreatedEventData = { invoice_amount: number;};const data2: OrderCreatedEventData = { invoice_amount: "5000" };// ^^^^^^^^^ TypeScript error:// Type 'string' is not assignable to type 'number'.
You get early error detection, IDE autocomplete, immediate feedback when schemas change, and self-documenting code.
Once you’ve completed all the prerequisites, you can generate types using the following command in CLI. It will create type definitions for all the live schemas in your workspace:
The output of the syntax generates a file with interfaces or definitions corresponding to all events and workflows that are linked to the schemas. So, there can’t be a mismatch between the schema mapped to the event or workflow while writing the code.
All events are suffixed with Event keyword and workflows are suffixed with Workflow keyword.
Always regenerate types after updating or committing schemas in SuprSend.
Why are some fields missing in my generated types?
This usually happens when:
The schema is still in draft and not committed
Types were not regenerated after schema changes
Ensure the schema is committed and regenerate the types using the CLI.
Why do I see type errors in my IDE but the code still runs?
This typically means:
Generated types are outdated
The schema was changed in SuprSend but types weren’t regenerated
You’re generating types from the wrong workspace
Regenerate types and verify the --workspace flag if used.
What happens if I don’t use type safety?
Without type safety:
Errors surface only at runtime
Invalid payloads may partially process
Workflow conditions and templates can break silently
Debugging becomes harder across environments
Should I edit the generated type files?
No. Generated files should not be edited manually. Any changes will be overwritten the next time types are regenerated. Always update schemas in SuprSend and regenerate types.
How often should I regenerate types?
You should regenerate types whenever:
A schema is added or updated
A field is added, removed, or renamed
A field’s datatype changes
Many teams automate this in CI/CD.
Can I automate type generation in CI/CD?
Yes. It’s recommended to add type generation to your CI/CD pipeline to ensure schemas and application code stay in sync across environments.
What does type safety mean in SuprSend workflows?
Type safety ensures that the data you send when triggering workflows or events strictly matches the schema defined in SuprSend. This helps catch missing fields, wrong data types, or invalid payloads during development instead of at runtime.
Why should I use type-safe workflow triggers?
Type-safe triggers help prevent production bugs caused by incorrect payloads, improve developer experience with autocomplete and validation, and ensure your workflow logic always receives valid and expected data.
How does SuprSend generate type-safe interfaces?
SuprSend generates strongly typed interfaces directly from your JSON schemas. You define the schema once in SuprSend, and the CLI generates language-specific types (TypeScript, Python, Go, Java, Kotlin, Swift, Dart) that stay in sync with your workflows.
Which languages are supported for type generation?