Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
### The Trigger.dev Private beta is now open. Sign up for access [here](https://bcymafitv0e.typeform.com/tddsignup#source=GitHubReadme).

 

![Hero](https://raw.githubusercontent.com/triggerdotdev/trigger.dev/eebe37109e33beae6390ee19029fce8a5934c84b/apps/webapp/public/images/logo-banner.png)


---

 


![Logo](https://trigger.dev/_next/static/media/triggerdotdev-logo.9226e5d0.png?imwidth=256)

[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/triggerdotdev.svg?style=social&label=Follow%20%40trigger.dev)](https://twitter.com/triggerdotdev)

[![Docs](https://img.shields.io/badge/-Documentation-blueviolet)](https://docs.trigger.dev)



# ⚙️ Automate complex workflows with code
# ⚙️ Effortless automation built for developers

Trigger workflows from APIs, on a schedule, or on demand. API calls are easy with authentication handled for you. Add durable delays that survive server restarts.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/examples/github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebarTitle: "GitHub"
description: "Here are some example workflows you could create using the GitHub integration."
---

You can explore all the supported GitHub functions [here](/).
You can explore all the supported GitHub functions [here](/integrations/apis/github/events/push).

## When a GitHub issue is created or modified, post to Slack

Expand Down
76 changes: 76 additions & 0 deletions apps/docs/examples/resend.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: "Resend"
sidebarTitle: "Resend"
description: "Here are some example workflows you could create using the Resend integration."
---

## Welcome email drip campaign

This workflow will get triggered and a Slack notification and welcom email will be sent straight away.
1 day later we check if the user has completed onboarding, if they have, they get a 'tips' email, otherwise they get a re-engagement email.

Integrations required: Resend, Slack

```ts
import { resend, slack } from "@trigger.dev/integrations";
import { customEvent, Trigger, sendEvent } from "@trigger.dev/sdk";
import React from "react";
import { z } from "zod";
import { getUser } from "../db";
import { InactiveEmail, TipsEmail, WelcomeEmail } from "./email-templates";

new Trigger({
id: "welcome-email-campaign",
name: "Welcome email drip campaign",
apiKey: "<my_api_key>",
on: customEvent({
name: "user.created",
schema: z.object({
userId: z.string(),
}),
}),
async run(event, context) {
//get the user data from the database
const user = await getUser(event.userId);

await slack.postMessage("send-to-slack", {
channelName: "new-users",
text: `New user signed up: ${user.name} (${user.email})`,
});

//Send the first email
const welcomeResponse = await resend.sendEmail("welcome-email", {
from: "Trigger.dev <james@email.trigger.dev>",
replyTo: "James <james@trigger.dev>",
to: user.email,
subject: "Welcome to Trigger.dev",
react: <WelcomeEmail name={user.name} />,
});
await context.logger.debug(
`Sent welcome email to ${welcomeResponse.to} with id ${welcomeResponse.id}`
);

//wait 1 day, check if the user has created a workflow and send the appropriate email
await context.waitFor("wait-a-while", { days: 1 });
const updatedUser = await getUser(event.userId);

if (updatedUser.hasOnboarded) {
await resend.sendEmail("onboarding-complete", {
from: "Trigger.dev <james@email.trigger.dev>",
replyTo: "James <james@trigger.dev>",
to: updatedUser.email,
subject: "Pro tips for workflows",
react: <TipsEmail name={updatedUser.name} />,
});
} else {
await resend.sendEmail("onboarding-incomplete", {
from: "Trigger.dev <james@email.trigger.dev>",
replyTo: "James <james@trigger.dev>",
to: updatedUser.email,
subject: "Help with your first workflow",
react: <InactiveEmail name={updatedUser.name} />,
});
}
},
}).listen();
```
2 changes: 0 additions & 2 deletions apps/docs/examples/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ sidebarTitle: "Slack"
description: "Here are some example workflows you could create using the Slack integration."
---

You can explore all the supported Slack functions [here](/).

## Post to Slack when a GitHub issue is created or modified

Integrations required: Slack, GitHub
Expand Down
19 changes: 6 additions & 13 deletions apps/docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,16 @@
"navigation": [
{
"group": "Getting Started",
"pages": [
"welcome",
"getting-started",
"get-help"
]
"pages": ["welcome", "getting-started", "get-help"]
},
{
"group": "Examples",
"pages": [
"examples/examples",
"examples/slack",
"examples/github",
"examples/shopify"
"examples/shopify",
"examples/resend"
]
},
{
Expand All @@ -70,15 +67,11 @@
"pages": [
{
"group": "Slack",
"pages": [
"integrations/apis/slack/actions/post-message"
]
"pages": ["integrations/apis/slack/actions/post-message"]
},
{
"group": "Resend.com",
"pages": [
"integrations/apis/resend/actions/send-email"
]
"pages": ["integrations/apis/resend/actions/send-email"]
}
]
},
Expand Down Expand Up @@ -135,4 +128,4 @@
"github": "https://github.com/triggerdotdev/trigger.dev",
"discord": "https://discord.gg/nkqV9xBYWy"
}
}
}
4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"dev": "mintlify dev --port 3050"
},
"devDependencies": {
"mintlify": "^2.0.15"
"mintlify": "^2.0.16"
}
}
}
10 changes: 10 additions & 0 deletions apps/docs/welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ Workflows live in your codebase so you can use your existing types, functions, v
_A workflow in action:_
![Test a run](/images/workflow-demo.gif)

<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/aFlwD0frvnQ"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen
></iframe>

<CardGroup>
<Card title="Getting Started" icon="circle-play" href="/getting-started">
Quickly get up and running with Trigger.dev by following our quick start
Expand Down
25 changes: 17 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.