Skip to content
Changelog

Report a bug

Events Reference

Type calls a subscription method with (ctx, event). This page describes event.

SourceEvent type in code
RecurringRecurringEvent
Slack message with a slack.message matcher and no schemaSlackMessageEvent
Other integration events with no schemaIntegrationEvent
Integration events with a schemaz.output<typeof schema>
Any integration source with debounce.delivery: "batch"An array of 1 to 100 of the events above
interface RecurringEvent {
readonly scheduledAt: string; // ISO date-time
}

scheduledAt is the time from Type’s scheduler, not the time that the run started. Use it in effect keys, for example report:${event.scheduledAt}, so that a retry of the same tick uses the same key.

Every integration event has this envelope:

interface IntegrationEvent<Data = unknown> {
type: string; // one of source.events
id: string; // the provider delivery ID
resourceId: string | null;
resourceType: string | null;
data: Data; // the provider's fields
}
  • id stays the same when a provider sends the same event again. Type uses it to run each event one time for each subscription.
  • Provider fields are always under data, not at the top level.
  • Without a schema, Type does not check the fields in data. Parse them in your method, or give a schema.
type SlackMessageEvent = {
type: "message";
id: string;
resourceId: string | null; // the channel ID
resourceType: string | null; // "channel"
data: {
channel: string;
ts: string;
thread_ts?: string | null;
user?: string | null;
text?: string | null;
subtype?: string | null;
bot_id?: string | null;
// other Slack fields are kept
};
};

Type uses this shape when the subscription has events: ["message"], a slack.message matcher, and no schema. If the matcher selects the message_deleted subtype, data.ts can be missing and data.deleted_ts is present.

Slack events use the Slack connection. Type receives them for you.

EventStarts when
messageSomeone posts, edits, or deletes a message in a channel that the Type app is in.
app_mentionSomeone mentions the Type app.
reaction_addedSomeone adds an emoji reaction.
reaction_removedSomeone removes an emoji reaction.
app_home_openedSomeone opens the Type app’s Home tab.
Envelope fieldValue
typeThe Slack event type.
idSlack’s event_id.
resourceType"channel" when the event has a channel, otherwise null.
resourceIdThe channel ID. For reactions, the channel of the message. Otherwise null.
dataThe Slack event object, unchanged.

GitHub events use the GitHub connection. Type receives them for you. Event names have the form github.<event>.<action>.

Event nameExamplesresourceType / resourceIdFields in data
github.pull_request.<action>github.pull_request.opened, github.pull_request.closedpull_request / PR numbertitle, url, state, merged, body, draft, baseBranch, headBranch, author
github.push—commit / the new commit SHAref, branch, commits, pusher
github.create.branch, github.create.tag—branch or tag / the refref, refType
github.delete.branch, github.delete.tag—branch or tag / the refref, refType
github.issues.<action>github.issues.openedissue / issue numbertitle, body, url, state, author
github.issue_comment.<action>github.issue_comment.createdpr_comment on a pull request, otherwise issue_comment / comment IDisPullRequest, issueNumber, prNumber, commentBody, url, author
github.pull_request_review.<action>github.pull_request_review.submittedpr_review / review IDprNumber, state, body, author, url
github.pull_request_review_comment.<action>github.pull_request_review_comment.createdpr_comment / comment IDprNumber, commentBody, author, url, path
github.release.<action>github.release.publishedrelease / release IDtagName, name, url, draft, prerelease
github.workflow_run.<action>github.workflow_run.completedworkflow_run / run IDname, branch, status, conclusion, headSha, url
github.check_run.<action>github.check_run.completedcheck_run / run IDname, branch, status, conclusion, headSha, url
github.check_suite.<action>github.check_suite.completedcheck_suite / suite IDname, branch, status, conclusion, headSha, url
github.status—commit / the SHAstate, context, description, url
  • All GitHub events also have repositoryFullName, repositoryId, and sender in data when GitHub sends them.
  • id is GitHub’s delivery ID.
  • <action> is GitHub’s action value, for example opened, closed, created, or completed. Type does not check it against a list. Use the names in GitHub’s webhook documentation.
  • A general comment on a pull request is an issue_comment event. An inline comment on a diff is a pull_request_review_comment event.
  • Type does not send these GitHub events to automations: deployment, deployment_status, pull_request_review_thread, label, and member.
  • The GitHub App of the connection must have the permission and the event subscription for each event. Saving an automation does not change the GitHub App settings.

Use the GitHub matchers to filter by repository, branch, action, and more.

A webhook adapter makes these events. The adapter sets type, id, resourceType, resourceId, and data. The subscription events must be a subset of the events that the adapter declares.

The resources field of a source filters events by resourceType and resourceId. The behavior is different for each kind of source.

SourceBehavior
SlackThe only key is channel. An event with no channel, or with a channel that is not in the list, is skipped.
GitHubAllowed keys: pull_request, commit, branch, tag, issue, release, issue_comment, pr_comment, pr_review, workflow_run, check_run, check_suite, github_event. A filter applies only to events with the same resourceType. Events with a different resourceType pass.
Custom webhookIf resources has keys, the event must have a resourceType that is a key, and its resourceId must be in the list. Other events are skipped.
  • Type saves each verified event before it starts work.
  • A provider retry with the same id does not start a second run for the same subscription.
  • Type does not promise the order of runs. With debounce.delivery: "latest", Type uses the order in which it received the events.
  • Events that come while an automation is paused are not saved for it. Resume does not replay them.
  • Events that Type saved before the pause, for example events in a debounce group, wait. They run after you resume, if the current code still subscribes to their event type.
  • A subscription that you add later does not get older events.
  • A provider event can come late or not at all. If your workflow cannot miss an item, add a recurring check that reads the source.