diff --git a/docs/guides/events.md b/docs/guides/events.md index 4f12115..6ade309 100644 --- a/docs/guides/events.md +++ b/docs/guides/events.md @@ -222,6 +222,33 @@ Below is a list of supported events and their payloads. +## Auth + +### Access Token Issued + +`auth.access_token.issued` + + + + + + + + + + + + + + + + + + + + +
Field Name Description
`workspaceId``String`: The workspace ID where the event occurred.
`namespaceName``String`: Name of the application.
+ ## Built-in IdP ### User Created diff --git a/docs/guides/executor/event-based-trigger.md b/docs/guides/executor/event-based-trigger.md index 69ade51..076330a 100644 --- a/docs/guides/executor/event-based-trigger.md +++ b/docs/guides/executor/event-based-trigger.md @@ -4,13 +4,13 @@ doc_type: guide # Event-based Trigger -In this trigger, you can specify the type of event that initiates it (e.g., TailorDB data update and StateFlow creation) and outline the specific conditions or criteria for its execution. +In this trigger, you can specify the type of event that initiates it (e.g., TailorDB data update, IdP user changes, or authentication events) and outline the specific conditions or criteria for its execution. Refer [Supported Events](/guides/events) to learn about the different types of events supported in the Tailor Platform. Follow the [tutorial](/tutorials/setup-executor/event-based-trigger) for setup instructions. ## Basic Event-Based Trigger Configuration -The following example shows the basic structure of an event-based trigger: +The following example shows the basic structure of an event-based trigger using the SDK: ```typescript {{title:'executors/event-based-executor.ts'}} import { createExecutor, recordCreatedTrigger } from "@tailor-platform/sdk"; @@ -34,39 +34,45 @@ export default createExecutor({ ## Event Data Access -Event-based triggers provide access to event-specific data through the `args` object. The available data depends on the event type: +Event-based triggers provide access to event-specific data through the `args` object. The available data depends on the event type. + +`args.eventType` is available for all event types, indicating which specific event triggered the executor (e.g., `tailordb.type_record.created`). This is useful when an executor listens to multiple event types and needs to differentiate between them. ### TailorDB Events +- `args.eventType` - The type of event that occurred (e.g., `tailordb.type_record.created`) - `args.namespaceName` - The namespace where the event occurred - `args.typeName` - The type name of the record -- `args.record` or `args.newRecord` - The record data -- `args.eventType` - The type of event that occurred +- `args.newRecord` - The new/created record data (available for created and updated events) +- `args.oldRecord` - The previous record data (available for updated and deleted events) -### Pipeline Events +### IdP Events +- `args.eventType` - The type of event that occurred (e.g., `idp.user.created`) +- `args.namespaceName` - The namespace where the event occurred +- `args.userId` - The ID of the affected IdP user + +### Auth Events + +- `args.eventType` - The type of event that occurred (e.g., `auth.access_token.issued`) - `args.namespaceName` - The namespace where the event occurred -- `args.resolverName` - The name of the resolver -- `args.status` - The execution status (success/failure) -- `args.result` - The resolver execution result -## Properties +### Pipeline Events -**Event-based Trigger Properties** +- `args.eventType` - The type of event that occurred (e.g., `pipeline.resolver.executed`) +- `args.namespaceName` - The namespace where the event occurred +- `args.resolverName` - The name of the resolver +- `args.result` - The resolver execution result (on success) +- `args.error` - The error message (on failure) -| Property | Type | Required | Description | -| ----------- | ------ | -------- | --------------------------------------------------------------- | -| `type` | string | Yes | The type of event that triggers the executor | -| `condition` | string | No | The condition that must be met for the executor to be triggered | +## Operation Types For detailed operation properties, see the dedicated operation pages: -- [TailorGraphql Operation Properties](tailor-graphql-operation#properties) -- [Webhook Operation Properties](webhook-operation#properties) -- [Function Operation Properties](function-operation#properties) -- [Job Function Operation Properties](job-function-operation#properties) - -Refer to the [Tailor Platform Provider documentation](https://registry.terraform.io/providers/tailor-platform/tailor/latest/docs/resources/executor) for more details on executor properties. +- [TailorGraphql Operation](tailor-graphql-operation) +- [Webhook Operation](webhook-operation) +- [Function Operation](function-operation) +- [Job Function Operation](job-function-operation) ## Related Documentation