Compare commits

...

29 Commits

Author SHA1 Message Date
Matt Aitken d2f4cb5677 Fixed feedback panel links (status page and docs) 2024-05-16 17:30:21 +01:00
Matt Aitken 2a3955303c Removed obvious docs links that are now missing pages 2024-05-16 16:03:07 +01:00
Matt Aitken 179ddf5696 Removed the link to Context from v3 docs 2024-05-16 16:02:05 +01:00
Matt Aitken 65c015b9c7 Merge remote-tracking branch 'origin/main' into v3/alerts-platform-status
# Conflicts:
#	apps/webapp/app/components/navigation/SideMenu.tsx
#	apps/webapp/app/env.server.ts
2024-05-16 15:42:44 +01:00
Matt Aitken cc3d92101e Use a separate email client for sending alerts 2024-05-16 15:31:48 +01:00
Matt Aitken 60abebabbc Only show the alerts sidemenu item if the feature is enabled 2024-05-16 15:31:24 +01:00
Matt Aitken 60e0a5c896 Added env vars for a different alert email address, and whether the feature is enabled or not 2024-05-16 15:31:12 +01:00
Matt Aitken 4c3c309bbe Fix the alerts docs link 2024-05-16 12:47:10 +01:00
James Ritchie 5aed70a9b6 Customers now have to contact us for Slack Connect Support. 2024-05-14 10:22:11 +01:00
James Ritchie ed5e27ea0a Hide the New Alerts button again if list is greater than 10 items 2024-05-13 18:11:19 +01:00
James Ritchie 36ae1b78a7 Docs: Added a new Troubleshooting section and Alerts docs page 2024-05-13 17:57:11 +01:00
James Ritchie c4a26bdce2 Docs: Renamed Community page 2024-05-13 17:56:42 +01:00
James Ritchie aa205cda51 Docs: removed Zod Tasks 2024-05-13 16:45:25 +01:00
James Ritchie 1a38178a29 Docs: removed Webhook Tasks 2024-05-13 16:44:22 +01:00
James Ritchie 33910628d8 Docs: removed Trigger Filters 2024-05-13 16:42:22 +01:00
James Ritchie 40ef08e0af Docs: removed Rollbacks 2024-05-13 16:41:52 +01:00
James Ritchie e8acfef6aa Docs: removed Using APIs 2024-05-13 16:41:28 +01:00
James Ritchie b304869448 Docs: removed Middleware 2024-05-13 16:40:49 +01:00
James Ritchie 5829c879dc Docs: removed automated tests 2024-05-13 16:39:59 +01:00
James Ritchie b5e5bfb5a2 Docs: Removed API reference: Functions 2024-05-13 16:37:37 +01:00
James Ritchie 83d6b5f5e1 Docs: Removed API reference: Objects 2024-05-13 16:35:13 +01:00
James Ritchie 9f986985bf Docs: Removed API reference: CLI 2024-05-13 16:34:12 +01:00
James Ritchie 36bf47d24f Docs: Removed Architecture section 2024-05-13 16:33:20 +01:00
James Ritchie 6fc980b4bb Docs: removed FAQs 2024-05-13 16:29:16 +01:00
James Ritchie 4fcbc574f7 Docs: removed limits performance 2024-05-13 16:26:14 +01:00
James Ritchie f08e4475ee Docs: Removed webhook tasks 2024-05-13 16:25:45 +01:00
James Ritchie 381787e126 Better external link icon 2024-05-13 16:25:12 +01:00
James Ritchie dba4716b83 Added a link to subscribe to alerts and improved the project alerts blank state 2024-05-13 15:43:29 +01:00
James Ritchie 470186d325 debug tooltip now scrolls 2024-05-13 15:18:11 +01:00
65 changed files with 162 additions and 414 deletions
+1 -8
View File
@@ -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"
+4
View File
@@ -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),
});
+2
View File
@@ -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,
};
}
+1 -1
View File
@@ -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 };
}
@@ -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>
+15
View File
@@ -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
View File
@@ -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",
-7
View File
@@ -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" />
-7
View File
@@ -1,7 +0,0 @@
---
title: "Architecture: Reliability"
sidebarTitle: "Reliability"
description: "How reliability is achieved with Trigger.dev."
---
<Snippet file="incomplete-docs.mdx" />
-6
View File
@@ -1,6 +0,0 @@
---
title: "Automated tests"
description: "Write automated tests of your tasks."
---
<Snippet file="coming-soon.mdx" />
+1 -1
View File
@@ -1,5 +1,5 @@
---
title: "Community"
title: "Discord Community"
url: "https://trigger.dev/discord"
---
-1
View File
@@ -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 | ⏳ |
-6
View File
@@ -1,6 +0,0 @@
---
title: "Frequently Asked Questions"
sidebarTitle: "FAQs"
---
<Snippet file="incomplete-docs.mdx" />
+1 -1
View File
@@ -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.
-6
View File
@@ -1,6 +0,0 @@
---
title: "Uptime status"
url: "https://trigger.openstatus.dev/"
---
View the [current Trigger.dev Cloud system status](https://trigger.openstatus.dev/).
-5
View File
@@ -1,5 +0,0 @@
---
title: "Limits & Performance"
---
<Snippet file="incomplete-docs.mdx" />
-6
View File
@@ -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" />
-7
View File
@@ -1,7 +0,0 @@
---
title: "trigger.dev build"
sidebarTitle: "build"
description: "This command will build your tasks."
---
<Snippet file="incomplete-docs.mdx" />
-7
View File
@@ -1,7 +0,0 @@
---
title: "trigger.dev deploy"
sidebarTitle: "deploy"
description: "This command will deploy your tasks."
---
<Snippet file="incomplete-docs.mdx" />
-7
View File
@@ -1,7 +0,0 @@
---
title: "trigger.dev dev"
sidebarTitle: "dev"
description: "This command runs your tasks locally."
---
<Snippet file="incomplete-docs.mdx" />
-7
View File
@@ -1,7 +0,0 @@
---
title: "trigger.dev init"
sidebarTitle: "init"
description: "This command will setup your v3 project."
---
<Snippet file="incomplete-docs.mdx" />
-7
View File
@@ -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" />
-7
View File
@@ -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" />
-7
View File
@@ -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" />
-7
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -1,6 +0,0 @@
---
title: "cron.task()"
description: "Trigger a task on a recurring schedule using a CRON expression."
---
<Snippet file="coming-soon.mdx" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -1,6 +0,0 @@
---
title: "queue()"
description: "Create queue settings that can be used when triggering a task."
---
<Snippet file="incomplete-docs.mdx" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -1,6 +0,0 @@
---
title: "task.trigger()"
description: "Trigger a task from your code."
---
<Snippet file="incomplete-docs.mdx" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -1,6 +0,0 @@
---
title: "wait.for()"
description: "Inside a task, wait for a period of time before continuing."
---
<Snippet file="incomplete-docs.mdx" />
-6
View File
@@ -1,6 +0,0 @@
---
title: "wait.until()"
description: "Inside a task, wait until the specified date before continuing."
---
<Snippet file="incomplete-docs.mdx" />
-6
View File
@@ -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" />
-6
View File
@@ -1,6 +0,0 @@
---
title: "zod.task()"
description: "A task where the payload is parsed using a zod schema."
---
<Snippet file="coming-soon.mdx" />
-6
View File
@@ -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" />
+2 -2
View File
@@ -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. Its 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.
+1 -1
View File
@@ -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.
-12
View File
@@ -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" />
-6
View File
@@ -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" />
-6
View File
@@ -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" />
+29
View File
@@ -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.
![Email alerts](/images/v3/troubleshooting-alerts-blank.png)
</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
![Email alerts](/images/v3/troubleshooting-alerts-modal.png)
</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".
![Disable and delete alerts](/images/v3/troubleshooting-alerts-disable-delete.png)
</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/)
-16
View File
@@ -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" />