Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d2f4cb5677 | |||
| 2a3955303c | |||
| 179ddf5696 | |||
| 65c015b9c7 | |||
| cc3d92101e | |||
| 60abebabbc | |||
| 60e0a5c896 | |||
| 4c3c309bbe | |||
| 5aed70a9b6 | |||
| ed5e27ea0a | |||
| 36ae1b78a7 | |||
| c4a26bdce2 | |||
| aa205cda51 | |||
| 1a38178a29 | |||
| 33910628d8 | |||
| 40ef08e0af | |||
| e8acfef6aa | |||
| b304869448 | |||
| 5829c879dc | |||
| b5e5bfb5a2 | |||
| 83d6b5f5e1 | |||
| 9f986985bf | |||
| 36bf47d24f | |||
| 6fc980b4bb | |||
| 4fcbc574f7 | |||
| f08e4475ee | |||
| 381787e126 | |||
| dba4716b83 | |||
| 470186d325 |
@@ -115,14 +115,7 @@ export function Feedback({ button, defaultValue = "bug" }: FeedbackProps) {
|
||||
Docs
|
||||
</LinkButton>
|
||||
<LinkButton
|
||||
to={docsPath("v3/introduction")}
|
||||
variant="tertiary/medium"
|
||||
LeadingIcon={BookOpenIcon}
|
||||
>
|
||||
v3 Docs (Developer preview)
|
||||
</LinkButton>
|
||||
<LinkButton
|
||||
to={"https://trigger.openstatus.dev/"}
|
||||
to={"https://status.trigger.dev/"}
|
||||
variant="tertiary/medium"
|
||||
LeadingIcon={ActivityIcon}
|
||||
>
|
||||
|
||||
@@ -20,9 +20,11 @@ export function AdminDebugTooltip({ children }: { children: React.ReactNode }) {
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<ShieldCheckIcon className="h-5 w-5" />
|
||||
<ShieldCheckIcon className="size-5" />
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="flex items-center gap-1">{children}</TooltipContent>
|
||||
<TooltipContent className="flex max-h-[90vh] items-center gap-1 overflow-y-auto">
|
||||
{children}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
);
|
||||
|
||||
@@ -233,31 +233,22 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
|
||||
</div>
|
||||
<hr className="border-charcoal-800" />
|
||||
<div>
|
||||
<StepNumber stepNumber="1" title="Create a new Slack channel" />
|
||||
<StepNumber stepNumber="1" title="Email us" />
|
||||
<StepContentContainer>
|
||||
<Paragraph>
|
||||
In your Slack app, create a new channel from the main menu by going to File{" "}
|
||||
<ArrowRightIcon className="inline h-4 w-4 text-text-dimmed" /> New Channel
|
||||
</Paragraph>
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="2" title="Setup your channel" />
|
||||
<StepContentContainer>
|
||||
<Paragraph>
|
||||
Name your channel, set its visibility and click 'Create'.
|
||||
</Paragraph>
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="3" title="Invite Trigger.dev" />
|
||||
<StepContentContainer>
|
||||
<Paragraph>
|
||||
Invite this email address to your channel:{" "}
|
||||
Send us an email to this address from your Trigger.dev account email
|
||||
address:
|
||||
<ClipboardField
|
||||
variant="primary/medium"
|
||||
value="james@trigger.dev"
|
||||
value="priority-support@trigger.dev"
|
||||
className="my-2"
|
||||
/>
|
||||
</Paragraph>
|
||||
</StepContentContainer>
|
||||
<StepNumber stepNumber="2" title="Look out for an invite from Slack" />
|
||||
<StepContentContainer>
|
||||
<Paragraph>
|
||||
As soon as we can, we'll accept your invitation and say hello!
|
||||
As soon as we can, we'll setup a Slack Connect channel and say hello!
|
||||
</Paragraph>
|
||||
</StepContentContainer>
|
||||
</div>
|
||||
@@ -551,6 +542,8 @@ function V3ProjectSideMenu({
|
||||
project: SideMenuProject;
|
||||
organization: MatchedOrganization;
|
||||
}) {
|
||||
const { alertsEnabled } = useFeatures();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SideMenuHeader title={"Project (v3)"} />
|
||||
@@ -603,13 +596,15 @@ function V3ProjectSideMenu({
|
||||
to={v3DeploymentsPath(organization, project)}
|
||||
data-action="deployments"
|
||||
/>
|
||||
{/* <SideMenuItem
|
||||
name="Alerts"
|
||||
icon={BellAlertIcon}
|
||||
iconColor="text-red-500"
|
||||
to={v3ProjectAlertsPath(organization, project)}
|
||||
data-action="alerts"
|
||||
/> */}
|
||||
{alertsEnabled && (
|
||||
<SideMenuItem
|
||||
name="Alerts"
|
||||
icon={BellAlertIcon}
|
||||
iconColor="text-red-500"
|
||||
to={v3ProjectAlertsPath(organization, project)}
|
||||
data-action="alerts"
|
||||
/>
|
||||
)}
|
||||
<SideMenuItem
|
||||
name="Project settings"
|
||||
icon="settings"
|
||||
|
||||
@@ -159,6 +159,10 @@ const EnvironmentSchema = z.object({
|
||||
ORG_SLACK_INTEGRATION_CLIENT_ID: z.string().optional(),
|
||||
ORG_SLACK_INTEGRATION_CLIENT_SECRET: z.string().optional(),
|
||||
|
||||
/** These enable the alerts feature in v3 */
|
||||
ALERT_FROM_EMAIL: z.string().optional(),
|
||||
ALERT_RESEND_API_KEY: z.string().optional(),
|
||||
|
||||
MAX_SEQUENTIAL_INDEX_FAILURE_COUNT: z.coerce.number().default(96),
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { requestUrl } from "./utils/requestUrl.server";
|
||||
export type TriggerFeatures = {
|
||||
isManagedCloud: boolean;
|
||||
v3Enabled: boolean;
|
||||
alertsEnabled: boolean;
|
||||
};
|
||||
|
||||
// If the request host is cloud.trigger.dev then we are on the managed cloud
|
||||
@@ -20,5 +21,6 @@ export function featuresForRequest(request: Request): TriggerFeatures {
|
||||
return {
|
||||
isManagedCloud,
|
||||
v3Enabled: env.V3_ENABLED === "true",
|
||||
alertsEnabled: env.ALERT_FROM_EMAIL !== undefined && env.ALERT_RESEND_API_KEY !== undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ import type { TriggerFeatures } from "~/features.server";
|
||||
export function useFeatures(): TriggerFeatures {
|
||||
const routeMatch = useTypedRouteLoaderData<typeof loader>("root");
|
||||
|
||||
return routeMatch?.features ?? { isManagedCloud: false, v3Enabled: false };
|
||||
return routeMatch?.features ?? { isManagedCloud: false, v3Enabled: false, alertsEnabled: false };
|
||||
}
|
||||
|
||||
+47
-13
@@ -1,6 +1,7 @@
|
||||
import { useForm } from "@conform-to/react";
|
||||
import { parse } from "@conform-to/zod";
|
||||
import {
|
||||
ArrowUpRightIcon,
|
||||
BoltIcon,
|
||||
BoltSlashIcon,
|
||||
BookOpenIcon,
|
||||
@@ -15,12 +16,14 @@ import { ActionFunctionArgs, LoaderFunctionArgs, json } from "@remix-run/server-
|
||||
import { SlackIcon } from "@trigger.dev/companyicons";
|
||||
import { ProjectAlertChannelType, ProjectAlertType } from "@trigger.dev/database";
|
||||
import assertNever from "assert-never";
|
||||
import { ExternalLinkIcon } from "lucide-react";
|
||||
import { typedjson, useTypedLoaderData } from "remix-typedjson";
|
||||
import { z } from "zod";
|
||||
import { PageBody, PageContainer } from "~/components/layout/AppLayout";
|
||||
import { Button, LinkButton } from "~/components/primitives/Buttons";
|
||||
import { ClipboardField } from "~/components/primitives/ClipboardField";
|
||||
import { DetailCell } from "~/components/primitives/DetailCell";
|
||||
import { Header2 } from "~/components/primitives/Headers";
|
||||
import { NavBar, PageAccessories, PageTitle } from "~/components/primitives/PageHeader";
|
||||
import { Paragraph } from "~/components/primitives/Paragraph";
|
||||
import {
|
||||
@@ -155,7 +158,7 @@ export default function Page() {
|
||||
<PageAccessories>
|
||||
<LinkButton
|
||||
LeadingIcon={BookOpenIcon}
|
||||
to={docsPath("v3/project-alerts")}
|
||||
to={docsPath("v3/troubleshooting-alerts")}
|
||||
variant="minimal/small"
|
||||
>
|
||||
Alerts docs
|
||||
@@ -164,16 +167,19 @@ export default function Page() {
|
||||
</NavBar>
|
||||
<PageBody>
|
||||
<div className={cn("flex h-full flex-col gap-3")}>
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
<LinkButton
|
||||
to={v3NewProjectAlertPath(organization, project)}
|
||||
variant="primary/small"
|
||||
LeadingIcon={PlusIcon}
|
||||
shortcut={{ key: "n" }}
|
||||
>
|
||||
New alert
|
||||
</LinkButton>
|
||||
</div>
|
||||
{alertChannels.length > 0 && alertChannels.length < 10 && (
|
||||
<div className="flex items-end justify-between">
|
||||
<Header2 className="">Project alerts</Header2>
|
||||
<LinkButton
|
||||
to={v3NewProjectAlertPath(organization, project)}
|
||||
variant="primary/small"
|
||||
LeadingIcon={PlusIcon}
|
||||
shortcut={{ key: "n" }}
|
||||
>
|
||||
New alert
|
||||
</LinkButton>
|
||||
</div>
|
||||
)}
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -214,14 +220,42 @@ export default function Page() {
|
||||
) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={5}>
|
||||
<div className="flex items-center justify-center">
|
||||
<Paragraph>No alerts have been created</Paragraph>
|
||||
<div className="flex flex-col items-center justify-center py-6">
|
||||
<Header2 spacing className="text-text-bright">
|
||||
You haven't created any project alerts yet
|
||||
</Header2>
|
||||
<Paragraph variant="small" className="mb-4">
|
||||
Get alerted when runs or deployments fail, or when deployments succeed.
|
||||
</Paragraph>
|
||||
<LinkButton
|
||||
to={v3NewProjectAlertPath(organization, project)}
|
||||
variant="primary/medium"
|
||||
LeadingIcon={PlusIcon}
|
||||
shortcut={{ key: "n" }}
|
||||
>
|
||||
New alert
|
||||
</LinkButton>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
<div className="mt-4">
|
||||
<Header2 className="mb-1">Platform alerts</Header2>
|
||||
<Paragraph variant="small" className="mb-4">
|
||||
Get email notifications when Trigger.dev creates, updates or resolves a platform
|
||||
incident.
|
||||
</Paragraph>
|
||||
<LinkButton
|
||||
variant="tertiary/medium"
|
||||
TrailingIcon={ArrowUpRightIcon}
|
||||
to="https://status.trigger.dev/"
|
||||
target="_blank"
|
||||
>
|
||||
Subscribe
|
||||
</LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<Outlet />
|
||||
</PageBody>
|
||||
|
||||
@@ -20,6 +20,17 @@ const client = singleton(
|
||||
})
|
||||
);
|
||||
|
||||
const alertsClient = singleton(
|
||||
"alerts-email-client",
|
||||
() =>
|
||||
new EmailClient({
|
||||
apikey: env.ALERT_RESEND_API_KEY,
|
||||
imagesBaseUrl: env.APP_ORIGIN,
|
||||
from: env.ALERT_FROM_EMAIL ?? "noreply@alerts.trigger.dev",
|
||||
replyTo: env.REPLY_TO_EMAIL ?? "help@email.trigger.dev",
|
||||
})
|
||||
);
|
||||
|
||||
export async function sendMagicLinkEmail(options: SendEmailOptions<AuthUser>): Promise<void> {
|
||||
// Auto redirect when in development mode
|
||||
if (env.NODE_ENV === "development") {
|
||||
@@ -67,3 +78,7 @@ export async function scheduleEmail(data: DeliverEmail, delay?: { seconds: numbe
|
||||
export async function sendEmail(data: DeliverEmail) {
|
||||
return client.send(data);
|
||||
}
|
||||
|
||||
export async function sendAlertEmail(data: DeliverEmail) {
|
||||
return alertsClient.send(data);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
ProjectAlertWebhookProperties,
|
||||
} from "~/models/projectAlert.server";
|
||||
import { DeploymentPresenter } from "~/presenters/v3/DeploymentPresenter.server";
|
||||
import { sendEmail } from "~/services/email.server";
|
||||
import { sendAlertEmail, sendEmail } from "~/services/email.server";
|
||||
import { logger } from "~/services/logger.server";
|
||||
import { decryptSecret } from "~/services/secrets/secretStore.server";
|
||||
import { workerQueue } from "~/services/worker.server";
|
||||
@@ -144,7 +144,7 @@ export class DeliverAlertService extends BaseService {
|
||||
return;
|
||||
}
|
||||
|
||||
await sendEmail({
|
||||
await sendAlertEmail({
|
||||
email: "alert-attempt",
|
||||
to: emailProperties.data.email,
|
||||
taskIdentifier: alert.taskRunAttempt.taskRun.taskIdentifier,
|
||||
@@ -177,7 +177,7 @@ export class DeliverAlertService extends BaseService {
|
||||
return;
|
||||
}
|
||||
|
||||
await sendEmail({
|
||||
await sendAlertEmail({
|
||||
email: "alert-deployment-failure",
|
||||
to: emailProperties.data.email,
|
||||
version: alert.workerDeployment.version,
|
||||
@@ -197,7 +197,7 @@ export class DeliverAlertService extends BaseService {
|
||||
}
|
||||
case "DEPLOYMENT_SUCCESS": {
|
||||
if (alert.workerDeployment) {
|
||||
await sendEmail({
|
||||
await sendAlertEmail({
|
||||
email: "alert-deployment-success",
|
||||
to: emailProperties.data.email,
|
||||
version: alert.workerDeployment.version,
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
+13
-72
@@ -95,13 +95,7 @@
|
||||
{
|
||||
"group": "Getting Started",
|
||||
"version": "v3 (Developer Preview)",
|
||||
"pages": [
|
||||
"v3/quick-start",
|
||||
"v3/upgrading-from-v2",
|
||||
"v3/changelog",
|
||||
"v3/feature-matrix",
|
||||
"v3/limits-performance"
|
||||
]
|
||||
"pages": ["v3/quick-start", "v3/upgrading-from-v2", "v3/changelog", "v3/feature-matrix"]
|
||||
},
|
||||
{
|
||||
"group": "Fundamentals",
|
||||
@@ -113,7 +107,7 @@
|
||||
"v3/apikeys",
|
||||
{
|
||||
"group": "Task types",
|
||||
"pages": ["v3/tasks-regular", "v3/tasks-scheduled", "v3/tasks-zod", "v3/tasks-webhooks"]
|
||||
"pages": ["v3/tasks-regular", "v3/tasks-scheduled"]
|
||||
},
|
||||
"v3/trigger-config"
|
||||
]
|
||||
@@ -158,12 +152,7 @@
|
||||
"v3/machines",
|
||||
"v3/idempotency",
|
||||
"v3/reattempting-replaying",
|
||||
"v3/trigger-filters",
|
||||
"v3/notifications",
|
||||
"v3/rollbacks",
|
||||
"v3/using-apis",
|
||||
"v3/middleware",
|
||||
"v3/automated-tests"
|
||||
"v3/notifications"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -189,77 +178,29 @@
|
||||
"v3/management-deactivate-schedule",
|
||||
"v3/management-activate-schedule"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Functions",
|
||||
"pages": [
|
||||
"v3/reference-task",
|
||||
"v3/reference-cron-task",
|
||||
"v3/reference-cron-dynamic",
|
||||
"v3/reference-interval-task",
|
||||
"v3/reference-interval-dynamic",
|
||||
"v3/reference-zod-task",
|
||||
"v3/reference-zod-catalog",
|
||||
"v3/reference-task-trigger",
|
||||
"v3/reference-task-trigger-and-wait",
|
||||
"v3/reference-task-batch-trigger",
|
||||
"v3/reference-task-batch-trigger-and-wait",
|
||||
"v3/reference-wait-for",
|
||||
"v3/reference-wait-until",
|
||||
"v3/reference-wait-for-event",
|
||||
"v3/reference-wait-for-request",
|
||||
"v3/reference-retry-on-throw",
|
||||
"v3/reference-retry-fetch",
|
||||
"v3/reference-retry-intercept-fetch",
|
||||
"v3/reference-notification-catalog",
|
||||
"v3/reference-notify",
|
||||
"v3/reference-queue"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Objects",
|
||||
"pages": ["v3/reference-context"]
|
||||
},
|
||||
{
|
||||
"group": "CLI",
|
||||
"pages": [
|
||||
"v3/reference-cli-init",
|
||||
"v3/reference-cli-dev",
|
||||
"v3/reference-cli-deploy",
|
||||
"v3/reference-cli-login",
|
||||
"v3/reference-cli-logout",
|
||||
"v3/reference-cli-update",
|
||||
"v3/reference-cli-build",
|
||||
"v3/reference-cli-who-am-i"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Architecture",
|
||||
"version": "v3 (Developer Preview)",
|
||||
"pages": [
|
||||
"v3/architecture-how-it-works",
|
||||
"v3/architecture-multi-tenant-queue",
|
||||
"v3/architecture-reliability"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Open source",
|
||||
"version": "v3 (Developer Preview)",
|
||||
"pages": ["v3/github-repo", "v3/open-source-self-hosting", "v3/open-source-contributing"]
|
||||
},
|
||||
{
|
||||
"group": "Help",
|
||||
"group": "Troubleshooting",
|
||||
"version": "v3 (Developer Preview)",
|
||||
"pages": [
|
||||
"v3/help-faqs",
|
||||
"v3/community",
|
||||
"v3/help-email",
|
||||
"v3/help-slack",
|
||||
"v3/help-uptime-status"
|
||||
"v3/troubleshooting-alerts",
|
||||
"v3/troubleshooting-uptime-status",
|
||||
"v3/troubleshooting-github-issues",
|
||||
"v3/troubleshooting-github-discussions"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Help",
|
||||
"version": "v3 (Developer Preview)",
|
||||
"pages": ["v3/community", "v3/help-slack", "v3/help-email"]
|
||||
},
|
||||
{
|
||||
"group": "Getting Started",
|
||||
"version": "v2",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "Architecture: How it works"
|
||||
sidebarTitle: "How it works"
|
||||
description: "An overview of how Trigger.dev v3 works under the hood."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "Architecture: Multi-tenant queue"
|
||||
sidebarTitle: "Multi-tenant queue"
|
||||
description: "We built a reliable and fair multi-tenant queue that controls triggering all tasks."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "Architecture: Reliability"
|
||||
sidebarTitle: "Reliability"
|
||||
description: "How reliability is achieved with Trigger.dev."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Automated tests"
|
||||
description: "Write automated tests of your tasks."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "Community"
|
||||
title: "Discord Community"
|
||||
url: "https://trigger.dev/discord"
|
||||
---
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ description: "What features are currently available in the Developer Preview"
|
||||
| Alerts | Add alerts in the UI for errors and deploys | ✅ |
|
||||
| [Scheduled tasks](/v3/tasks-scheduled) | A task that can be triggered on a schedule | ✅ |
|
||||
| [Zod tasks](/v3/tasks-zod) | Define tasks using Zod schemas | ⏳ |
|
||||
| [Webhook tasks](/v3/tasks-webhooks) | A task that can be triggered by a webhook | ⏳ |
|
||||
| Full text search of runs | Find a run by searching the payload and output | ⏳ |
|
||||
| Logs view with search | All logs view with filtering and full text search | ⏳ |
|
||||
| Notifications | Send data to your web app from a run | ⏳ |
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Frequently Asked Questions"
|
||||
sidebarTitle: "FAQs"
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "Slack"
|
||||
title: "Slack support"
|
||||
---
|
||||
|
||||
If you have a paid Trigger.dev account, you can request a private Slack Connect channel.
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Uptime status"
|
||||
url: "https://trigger.openstatus.dev/"
|
||||
---
|
||||
|
||||
View the [current Trigger.dev Cloud system status](https://trigger.openstatus.dev/).
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: "Limits & Performance"
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Middleware"
|
||||
description: "This function is called before the `run` function, it allows you to wrap the run function with custom code."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev build"
|
||||
sidebarTitle: "build"
|
||||
description: "This command will build your tasks."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev deploy"
|
||||
sidebarTitle: "deploy"
|
||||
description: "This command will deploy your tasks."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev dev"
|
||||
sidebarTitle: "dev"
|
||||
description: "This command runs your tasks locally."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev init"
|
||||
sidebarTitle: "init"
|
||||
description: "This command will setup your v3 project."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev login"
|
||||
sidebarTitle: "login"
|
||||
description: "This command will log you in to the CLI. Required to run any other command."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev logout"
|
||||
sidebarTitle: "logout"
|
||||
description: "This command will log you out of the CLI."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev update"
|
||||
sidebarTitle: "update"
|
||||
description: "This command can be used to update all of your trigger.dev packages to the latest versions."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: "trigger.dev whoami"
|
||||
sidebarTitle: "whoami"
|
||||
description: "This command will return information about you, the logged in user."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Context"
|
||||
description: "The Context object is part of the `run` function parameter and provides information about the current run."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "cron.dynamic()"
|
||||
description: "Trigger a task with many different CRON schedules. For example you can use this to let your users select when they want a reminder."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "cron.task()"
|
||||
description: "Trigger a task on a recurring schedule using a CRON expression."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "interval.dynamic()"
|
||||
description: "Trigger a task with many different interval schedules. For example you can use this to let your users select how often they want a reminder."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "interval.task()"
|
||||
description: "Trigger a task on a recurring schedule using the time interval you want between runs."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "notification.catalog()"
|
||||
description: "Create a set of events that can be emitted from your tasks. These can be subscribed to from your application to provide real-time updates to your users."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "notify()"
|
||||
description: "Send a notification from your tasks. These can be subscribed to from your application to provide real-time updates to your users."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "queue()"
|
||||
description: "Create queue settings that can be used when triggering a task."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "retry.fetch()"
|
||||
description: "Inside a task, do a fetch request that will retry (you can specify the retry conditions)."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "retry.interceptFetch()"
|
||||
description: "Useful when writing automated tests – it will intercept matching HTTP requests and respond with what you provide."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "retry.onThrow()"
|
||||
description: "Inside a task, retry the wrapped code if it throws an error."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "task.batchTriggerAndWait()"
|
||||
description: "Trigger a task many times at once from inside another task, and wait for all the results."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "task.batchTrigger()"
|
||||
description: "Trigger a task many times at once from your code."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "task.triggerAndWait()"
|
||||
description: "Trigger a task from inside another task, and wait for the result."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "task.trigger()"
|
||||
description: "Trigger a task from your code."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "task()"
|
||||
description: "The task() function is the simplest way to create a long-running task."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "wait.forEvent()"
|
||||
description: "Inside a task, wait until a specific event is received before continuing."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "wait.forRequest()"
|
||||
description: "Inside a task, wait until a specific request is received before continuing."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "wait.for()"
|
||||
description: "Inside a task, wait for a period of time before continuing."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "wait.until()"
|
||||
description: "Inside a task, wait until the specified date before continuing."
|
||||
---
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "zod.catalog()"
|
||||
description: "Create a set of events with names and payloads that are parsed using Zod schemas."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "zod.task()"
|
||||
description: "A task where the payload is parsed using a zod schema."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Rollbacks"
|
||||
description: "You can rollback changes when errors happen, to give transactional guarantees to your operations."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -59,7 +59,7 @@ This is used to identify your task so it can be triggered, managed, and you can
|
||||
Your custom code inside `run()` will be executed when your task is triggered. It’s an async function that has two arguments:
|
||||
|
||||
1. The run payload - the data that you pass to the task when you trigger it.
|
||||
2. An object with `ctx` about the run ([Context](/v3/reference-context)), and any output from the optional `init` function that runs before every run attempt.
|
||||
2. An object with `ctx` about the run (Context), and any output from the optional `init` function that runs before every run attempt.
|
||||
|
||||
Anything you return from the `run` function will be the result of the task. Data you return must be JSON serializable: strings, numbers, booleans, arrays, objects, and null.
|
||||
|
||||
@@ -85,7 +85,7 @@ export const taskWithRetries = task({
|
||||
});
|
||||
```
|
||||
|
||||
For more information read [the retrying guide](/v3/retrying), or see the [SDK reference](/v3/reference-task).
|
||||
For more information read [the retrying guide](/v3/retrying).
|
||||
|
||||
It's also worth mentioning that you can [retry a block of code](/v3/retrying) inside your tasks as well.
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Sometimes OpenAI calls can take a long time to complete, or they can fail. This
|
||||
|
||||
This example uses Resend to send a sequence of emails over several days.
|
||||
|
||||
Each email is wrapped in [retry.onThrow](/v3/reference-retry-on-throw). This will retry the block of code if an error is thrown. This is useful when you don't want to retry the whole task, but just a part of it. The entire task will use the default retrying, so can also retry.
|
||||
Each email is wrapped in `retry.onThrow`. This will retry the block of code if an error is thrown. This is useful when you don't want to retry the whole task, but just a part of it. The entire task will use the default retrying, so can also retry.
|
||||
|
||||
Additionally this task uses `wait.for` to wait for a certain amount of time before sending the next email. During the waiting time, the task will be paused and will not consume any resources.
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: "Webhook tasks"
|
||||
description: "A task that is triggered when a webhook is received from an API."
|
||||
---
|
||||
|
||||
## Built-in webhooks triggers
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
|
||||
## How to manually use Trigger.dev with webhooks
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Zod tasks"
|
||||
description: "You can use Zod to define a catalog of events and then attach those events to your tasks."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: "Trigger filters"
|
||||
description: "You can add filters to your tasks so they're only triggered when certain conditions are met."
|
||||
---
|
||||
|
||||
<Snippet file="coming-soon.mdx" />
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: "Alerts"
|
||||
description: "Get alerted when runs or deployments fail, or when deployments succeed."
|
||||
---
|
||||
|
||||
<Steps>
|
||||
|
||||
<Step title="Create a new alert">
|
||||
Click on "Alerts" in the left hand side menu, then click on "New alert" to open the new alert modal.
|
||||

|
||||
</Step>
|
||||
|
||||
<Step title="Choose your alert method">
|
||||
Choose to be notified by email, Slack notification or webhook whenever:
|
||||
|
||||
- a run fails
|
||||
- a deployment fails
|
||||
- a deployment succeeds
|
||||
|
||||

|
||||
</Step>
|
||||
|
||||
<Step title="Delete or disable alerts">
|
||||
Click on the triple dot menu on the right side of the table row and select "Disable" or "Delete".
|
||||
|
||||

|
||||
</Step>
|
||||
|
||||
</Steps>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "GitHub Discussions"
|
||||
url: "https://github.com/triggerdotdev/trigger.dev/discussions"
|
||||
---
|
||||
|
||||
Please [join our community on Discord](https://github.com/triggerdotdev/trigger.dev/discussions) to ask questions, share your projects, and get help from other developers.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "GitHub Issues"
|
||||
url: "https://github.com/triggerdotdev/trigger.dev/issues"
|
||||
---
|
||||
|
||||
Please [join our community on Discord](https://github.com/triggerdotdev/trigger.dev/issues) to ask questions, share your projects, and get help from other developers.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "Uptime Status"
|
||||
---
|
||||
|
||||
Get email notifications when Trigger.dev creates, updates or resolves a platform incident.
|
||||
[Subscribe](https://status.trigger.dev/)
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
title: "Using APIs"
|
||||
description: "You can use any Node.js library inside the run function, or do HTTP requests."
|
||||
---
|
||||
|
||||
## Using Node.js SDKs
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
|
||||
## Using fetch or axios
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
|
||||
## Using webhooks
|
||||
|
||||
<Snippet file="incomplete-docs.mdx" />
|
||||
Reference in New Issue
Block a user