# Type-safe triggers using the Framework SDK - Novu Changelog

> Novu changelog: Type-safe triggers using the Framework SDK. Learn about the latest updates, features, and improvements to the Novu notification infrastr...

Canonical: https://novu.co/changelog/type-safe-triggers-using-the-framework-sdk/

Markdown: https://novu.co/changelog/type-safe-triggers-using-the-framework-sdk.md

Last updated: 2024-07-15T09:44:33.694Z

Published: 2024-07-15T09:44:33.694Z

You can now reference a created workflow using the Framework SDK, and get a complete end-to-end type safety and auto-completion for your triggers.

```javascript
import { workflow } from '@novu/framework';

const commentWorkflow = workflow('comment-on-post', async ({ step }) => {
  await step.email();
}, {
 payloadSchema: z.object({
   post: z.object({
     id: z.number(),
     title: z.string()
   })
 })
});

// complete type-safety for the payload object
commentWorkflow.trigger({
  to: { subscriberId: 'joe@acme.com' },
  payload: {
    post: {
      id: 1234,
      title: 'Post Title'
  }
});
```

It's still possible to make the trigger from any of our backend SDKs (Node, PHP, Go, etc..) following the trigger command:

```python
from novu.api import EventApi

url = "https://api.novu.co"
api_key = "<NOVU_API_KEY>"

novu = EventApi(url, api_key).trigger(
    name="<WORKFLOW_TRIGGER_IDENTIFIER>", # This is the Workflow ID
    recipients="<UNIQUE_SUBSCRIBER_IDENTIFIER>",
    payload={},  # Your custom Novu payload goes here
)
```
