diff --git a/llms-full.txt b/llms-full.txt index b7f48104a..4fe840256 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -72300,7 +72300,7 @@ import { Redis } from "@upstash/redis"; const redis = Redis.fromEnv(); -await redis.zadd("key", 1, "member"); +await redis.zadd("key", { score: 1, member: "member" }); const value = await redis.zincrby("key", 2, "member"); console.log(value); // 3 ``` @@ -73032,7 +73032,7 @@ await redis.zadd("key", { score: 1, member: "one"}, { score: 2, member: "two" }, ); -const elements = await redis.zlexcount("key", "two", "+"); +const elements = await redis.zlexcount("key", "[two", "+"); console.log(elements); // 1 ``` @@ -108266,7 +108266,7 @@ The Search SDK supports defining your content and metadata types at the index le ```typescript {4,5,6} import { Search } from "@upstash/search"; -const client = new Search(); +const client = Search.fromEnv(); type Content = { title: string, genre: string }; type Metadata = { year: number }; @@ -118019,7 +118019,7 @@ This flexibility allows you to tailor the tools to your specific needs while lev ```ts WorkflowTool (custom) -import { WorkflowTool } from '@upstash/workflow' +import { WorkflowTool } from '@upstash/workflow-agents' import { z } from 'zod' import * as mathjs from 'mathjs' @@ -120949,7 +120949,7 @@ const { workflowRunId } = await client.trigger({ workflowRunId: "my-workflow", // optional workflow run id retries: 3, // optional retries retryDelay: "1000 * (1 + retried)", // optional delay between retries - delay: "10s" // optional delay value + delay: "10s", // optional delay value failureUrl: "https://", // optional failure url flowControl: { // optional flow control key: "USER_GIVEN_KEY", @@ -121930,7 +121930,7 @@ You can delete entries individually, in bulk by IDs, or by using filters such as await client.dlq.delete(["dlq-12345", "dlq-67890"]); // delete by filters - await client.dlq.delete({ label: "my-label" }); + await client.dlq.delete({ filter: { label: "my-label" } }); // delete all await client.dlq.delete({ all: true }); @@ -122120,7 +122120,7 @@ If you think this advanced option fits your need, you can configure it by passin const client = new Client({ token: "" }) const { workflowRunId } = await client.trigger({ - url: "https:///workflow" + url: "https:///workflow", failureUrl: "https:///workflow-failure" }) ``` @@ -122252,7 +122252,7 @@ export const { POST } = serve(async (context) => { await context.run( "charge customer", - () => chargeCustomer(), + () => chargeCustomer("customer-id"), { flowControl: { key: "payment-provider", parallelism: 3 }, } @@ -122433,7 +122433,7 @@ const { { workflow: analyzeContent, body: "test", - header: {...}, // headers to pass to anotherWorkflow (optional) + headers: {...}, // headers to pass to anotherWorkflow (optional) retries, // number of retries (optional, default: 3) flowControl, // flow control settings (optional) workflowRunId // workflowRunId to set (optional) @@ -122488,7 +122488,7 @@ This way, you can invoke a workflow simply by passing the object to `context.inv workflow: workflowOne, body: "user-1" } - ), + ); }); ``` @@ -122530,7 +122530,7 @@ This way, you can invoke a workflow simply by passing the object to `context.inv // 👇 optionally label the invoked run; single string or array label: ["team-a", "high-priority"], } - ), + ); }); ``` @@ -122740,7 +122740,7 @@ By default, the retry count is set to **3**, and an **exponential backoff** dela ```javascript Default Backoff Algorithm // n = how many times this request has been retried -delay = min(86400, e ** (2.5*n)) // in seconds +delay = Math.min(86400, Math.E ** (2.5*n)) // in seconds ``` | Retry Attempt | Algorithm | Delay | diff --git a/qstash/sdks/ts/examples/dlq.mdx b/qstash/sdks/ts/examples/dlq.mdx index b5c2452bd..3dafa63b7 100644 --- a/qstash/sdks/ts/examples/dlq.mdx +++ b/qstash/sdks/ts/examples/dlq.mdx @@ -12,7 +12,7 @@ import { Client } from "@upstash/qstash"; const client = new Client({ token: "" }); const all_messages = []; -let cursor = null; +let cursor: string | undefined; while (true) { const res = await client.dlq.listMessages({ cursor }); all_messages.push(...res.messages); diff --git a/redis/commands/sorted-set/zincrby.mdx b/redis/commands/sorted-set/zincrby.mdx index 6fbae2778..c3902aeed 100644 --- a/redis/commands/sorted-set/zincrby.mdx +++ b/redis/commands/sorted-set/zincrby.mdx @@ -61,7 +61,7 @@ import { Redis } from "@upstash/redis"; const redis = Redis.fromEnv(); -await redis.zadd("key", 1, "member"); +await redis.zadd("key", { score: 1, member: "member" }); const value = await redis.zincrby("key", 2, "member"); console.log(value); // 3 ``` diff --git a/redis/commands/sorted-set/zlexcount.mdx b/redis/commands/sorted-set/zlexcount.mdx index 807aa8518..d11c12ce5 100644 --- a/redis/commands/sorted-set/zlexcount.mdx +++ b/redis/commands/sorted-set/zlexcount.mdx @@ -61,7 +61,7 @@ await redis.zadd("key", { score: 1, member: "one"}, { score: 2, member: "two" }, ); -const elements = await redis.zlexcount("key", "two", "+"); +const elements = await redis.zlexcount("key", "[two", "+"); console.log(elements); // 1 ``` diff --git a/redis/sdks/py/commands/list/lpush.mdx b/redis/sdks/py/commands/list/lpush.mdx index bd85c7d22..8d8fa269b 100644 --- a/redis/sdks/py/commands/list/lpush.mdx +++ b/redis/sdks/py/commands/list/lpush.mdx @@ -23,7 +23,7 @@ description: Push an element at the head of the list. ```py Example assert redis.lpush("mylist", "one", "two", "three") == 3 -assert lrange("mylist", 0, -1) == ["three", "two", "one"] +assert redis.lrange("mylist", 0, -1) == ["three", "two", "one"] ``` diff --git a/redis/sdks/py/commands/list/lpushx.mdx b/redis/sdks/py/commands/list/lpushx.mdx index 73c21257c..6fdb4ae24 100644 --- a/redis/sdks/py/commands/list/lpushx.mdx +++ b/redis/sdks/py/commands/list/lpushx.mdx @@ -29,7 +29,7 @@ redis.lpush("mylist", "one") assert redis.lpushx("mylist", "two", "three") == 3 -assert lrange("mylist", 0, -1) == ["three", "two", "one"] +assert redis.lrange("mylist", 0, -1) == ["three", "two", "one"] # Non existing key assert redis.lpushx("non-existent-list", "one") == 0 diff --git a/redis/sdks/py/commands/list/lset.mdx b/redis/sdks/py/commands/list/lset.mdx index 7c55bd5d7..ec08e3123 100644 --- a/redis/sdks/py/commands/list/lset.mdx +++ b/redis/sdks/py/commands/list/lset.mdx @@ -32,8 +32,8 @@ assert redis.lset("mylist", 1, "Hello") == True assert redis.lrange("mylist", 0, -1) == ["one", "Hello", "three"] -assert redis.lset("mylist", 5, "Hello") == False +assert redis.lset("mylist", 2, "World") == True -assert redis.lrange("mylist", 0, -1) == ["one", "Hello", "three"] - ``` +assert redis.lrange("mylist", 0, -1) == ["one", "Hello", "World"] +``` diff --git a/redis/sdks/py/commands/list/ltrim.mdx b/redis/sdks/py/commands/list/ltrim.mdx index 5e02c7f4d..739dc4150 100644 --- a/redis/sdks/py/commands/list/ltrim.mdx +++ b/redis/sdks/py/commands/list/ltrim.mdx @@ -28,7 +28,7 @@ description: Trim a list to the specified range ```py Example redis.rpush("mylist", "one", "two", "three") -assert redis.ltrim("mylist", 0, 1) == True +assert redis.ltrim("mylist", 0, 1) == "OK" assert redis.lrange("mylist", 0, -1) == ["one", "two"] ``` diff --git a/redis/sdks/py/commands/list/rpush.mdx b/redis/sdks/py/commands/list/rpush.mdx index 9ef911a27..09daa3a77 100644 --- a/redis/sdks/py/commands/list/rpush.mdx +++ b/redis/sdks/py/commands/list/rpush.mdx @@ -24,7 +24,7 @@ description: Push an element at the end of the list. ```py Example assert redis.rpush("mylist", "one", "two", "three") == 3 -assert lrange("mylist", 0, -1) == ["one", "two", "three"] +assert redis.lrange("mylist", 0, -1) == ["one", "two", "three"] ``` diff --git a/redis/sdks/py/commands/list/rpushx.mdx b/redis/sdks/py/commands/list/rpushx.mdx index 06ae8f515..a8697b81c 100644 --- a/redis/sdks/py/commands/list/rpushx.mdx +++ b/redis/sdks/py/commands/list/rpushx.mdx @@ -24,9 +24,11 @@ description: Push an element at the end of the list only if the list exists. ```py Example -assert redis.rpushx("mylist", "one", "two", "three") == 3 +redis.rpush("mylist", "a") -assert lrange("mylist", 0, -1) == ["one", "two", "three"] +assert redis.rpushx("mylist", "one", "two", "three") == 4 + +assert redis.lrange("mylist", 0, -1) == ["a", "one", "two", "three"] # Non existing key assert redis.rpushx("non-existent-list", "one") == 0 diff --git a/redis/sdks/py/commands/scripts/evalsha.mdx b/redis/sdks/py/commands/scripts/evalsha.mdx index 52a6d343f..494f2789e 100644 --- a/redis/sdks/py/commands/scripts/evalsha.mdx +++ b/redis/sdks/py/commands/scripts/evalsha.mdx @@ -28,7 +28,7 @@ description: Evaluate a cached Lua script server side. ```py Example result = redis.evalsha("fb67a0c03b48ddbf8b4c9b011e779563bdbc28cb", args=["hello"]) -assert result = "hello" +assert result == "hello" ``` diff --git a/redis/sdks/py/commands/scripts/evalsha_ro.mdx b/redis/sdks/py/commands/scripts/evalsha_ro.mdx index 8fc58eda8..bd9f0bd1f 100644 --- a/redis/sdks/py/commands/scripts/evalsha_ro.mdx +++ b/redis/sdks/py/commands/scripts/evalsha_ro.mdx @@ -28,7 +28,7 @@ description: Evaluate a cached read-only Lua script server side. ```py Example result = redis.evalsha_ro("fb67a0c03b48ddbf8b4c9b011e779563bdbc28cb", args=["hello"]) -assert result = "hello" +assert result == "hello" ``` diff --git a/redis/sdks/py/commands/scripts/script_exists.mdx b/redis/sdks/py/commands/scripts/script_exists.mdx index f1cca602a..f12810f98 100644 --- a/redis/sdks/py/commands/scripts/script_exists.mdx +++ b/redis/sdks/py/commands/scripts/script_exists.mdx @@ -19,7 +19,7 @@ description: Check if scripts exist in the script cache. ```py Example # Script 1 exists # Script 0 does not -await redis.scriptExists("", "") == [1, 0] +assert redis.script_exists("", "") == [True, False] ``` diff --git a/redis/sdks/py/commands/set/sdiffstore.mdx b/redis/sdks/py/commands/set/sdiffstore.mdx index cf9672b22..30e075734 100644 --- a/redis/sdks/py/commands/set/sdiffstore.mdx +++ b/redis/sdks/py/commands/set/sdiffstore.mdx @@ -30,7 +30,7 @@ redis.sadd("key2", "c", "d", "e") # Store the result in a new set assert redis.sdiffstore("res", "key1", "key2") == 2 -assert redis.smembers("set") == {"a", "b"} +assert set(redis.smembers("res")) == {"a", "b"} ``` diff --git a/redis/sdks/py/commands/set/sinterstore.mdx b/redis/sdks/py/commands/set/sinterstore.mdx index 998bfd39f..5f9b3197c 100644 --- a/redis/sdks/py/commands/set/sinterstore.mdx +++ b/redis/sdks/py/commands/set/sinterstore.mdx @@ -26,7 +26,7 @@ redis.sadd("set1", "a", "b", "c"); redis.sadd("set2", "c", "d", "e"); -assert redis.sinter("destination", "set1", "set2") == 1 +assert redis.sinterstore("destination", "set1", "set2") == 1 ``` diff --git a/redis/sdks/py/commands/set/smove.mdx b/redis/sdks/py/commands/set/smove.mdx index 96aadaedc..76502d78b 100644 --- a/redis/sdks/py/commands/set/smove.mdx +++ b/redis/sdks/py/commands/set/smove.mdx @@ -30,9 +30,9 @@ redis.sadd("dest", "four") assert redis.smove("src", "dest", "three") == True -assert redis.smembers("source") == {"one", "two"} +assert set(redis.smembers("src")) == {"one", "two"} -assert redis.smembers("destination") == {"three", "four"} +assert set(redis.smembers("dest")) == {"three", "four"} ``` diff --git a/redis/sdks/py/commands/set/spop.mdx b/redis/sdks/py/commands/set/spop.mdx index aab7085de..cef8c271b 100644 --- a/redis/sdks/py/commands/set/spop.mdx +++ b/redis/sdks/py/commands/set/spop.mdx @@ -31,7 +31,7 @@ assert redis.spop("myset") in {"one", "two", "three"} ```py With Count redis.sadd("myset", "one", "two", "three") -assert redis.spop("myset", 2) in {"one", "two", "three"} +assert set(redis.spop("myset", 2)) <= {"one", "two", "three"} ``` diff --git a/redis/sdks/py/commands/set/srandmember.mdx b/redis/sdks/py/commands/set/srandmember.mdx index 07948dc93..d67f2f695 100644 --- a/redis/sdks/py/commands/set/srandmember.mdx +++ b/redis/sdks/py/commands/set/srandmember.mdx @@ -31,7 +31,7 @@ assert redis.srandmember("myset") in {"one", "two", "three"} ```py With Count redis.sadd("myset", "one", "two", "three") -assert redis.srandmember("myset", 2) in {"one", "two", "three"} +assert set(redis.srandmember("myset", 2)) <= {"one", "two", "three"} ``` diff --git a/redis/sdks/py/commands/set/sscan.mdx b/redis/sdks/py/commands/set/sscan.mdx index ba8ed9b6d..daae0639e 100644 --- a/redis/sdks/py/commands/set/sscan.mdx +++ b/redis/sdks/py/commands/set/sscan.mdx @@ -34,7 +34,7 @@ description: Scan a set # Get all members of a set. cursor = 0 -results = set() +results = [] while True: cursor, keys = redis.sscan("myset", cursor, match="*") diff --git a/redis/tutorials/tanstack_chat_persistence.mdx b/redis/tutorials/tanstack_chat_persistence.mdx index 88298ba73..618f8ebf1 100644 --- a/redis/tutorials/tanstack_chat_persistence.mdx +++ b/redis/tutorials/tanstack_chat_persistence.mdx @@ -26,12 +26,12 @@ UPSTASH_REDIS_REST_TOKEN="..." ## The adapter -A persistence adapter is just an object with three methods. Each may be sync or async — the client awaits them. We store the messages array under a namespaced key and revive `createdAt` (which becomes a string through JSON) on read. +A persistence adapter is just an object with three methods. Each may be sync or async — the client awaits them. The client hands it one record per thread (the messages, plus a resume pointer while a run is in flight); we store that record under a namespaced key and revive each message's `createdAt` (which becomes a string through JSON) on read. ```typescript // upstash-persistence.ts import type { Redis } from "@upstash/redis"; -import type { ChatClientPersistence, UIMessage } from "@tanstack/ai-client"; +import type { ChatClientPersistence, ChatPersistedState } from "@tanstack/ai-client"; type UpstashPersistenceOptions = { redis: Redis; @@ -41,23 +41,26 @@ type UpstashPersistenceOptions = { export function upstashPersistence(options: UpstashPersistenceOptions): ChatClientPersistence { const { redis, prefix = "tanstack:chat:", ttlSeconds } = options; - const key = (id: string) => `${prefix}${id}`; + const key = (threadId: string) => `${prefix}${threadId}`; return { - async getItem(id) { - const stored = await redis.get>(key(id)); + async getItem(threadId) { + const stored = await redis.get(key(threadId)); if (!stored) return null; // createdAt round-trips as a string through JSON; revive it. - return stored.map((m) => ({ - ...m, - createdAt: typeof m.createdAt === "string" ? new Date(m.createdAt) : m.createdAt, - })); + return { + ...stored, + messages: stored.messages.map((m) => ({ + ...m, + createdAt: typeof m.createdAt === "string" ? new Date(m.createdAt) : m.createdAt, + })), + }; }, - async setItem(id, messages) { - await redis.set(key(id), messages, ttlSeconds ? { ex: ttlSeconds } : undefined); + async setItem(threadId, state) { + await redis.set(key(threadId), state, ttlSeconds ? { ex: ttlSeconds } : undefined); }, - async removeItem(id) { - await redis.del(key(id)); + async removeItem(threadId) { + await redis.del(key(threadId)); }, }; } @@ -65,17 +68,18 @@ export function upstashPersistence(options: UpstashPersistenceOptions): ChatClie ## Use it -Pass the adapter as `persistence` and give the client a stable `id` — that `id` is the storage key, so the same `id` loads the same conversation back. +Pass the adapter as `persistence` and give the client a stable `threadId` — that `threadId` is the storage key, so the same `threadId` loads the same conversation back. ```typescript import { Redis } from "@upstash/redis"; -import { ChatClient } from "@tanstack/ai-client"; +import { ChatClient, fetchServerSentEvents } from "@tanstack/ai-client"; import { upstashPersistence } from "./upstash-persistence"; const redis = Redis.fromEnv(); +const connection = fetchServerSentEvents("/api/chat"); const chat = new ChatClient({ - id: "conversation-123", + threadId: "conversation-123", connection, // your OpenAI/SSE transport persistence: upstashPersistence({ redis }), // <- that's it }); @@ -85,22 +89,22 @@ await chat.sendMessage("In one short sentence, what is Upstash Redis?"); The client now: -- **Hydrates on construction** — calls `getItem(id)` and populates itself (overriding `initialMessages`). -- **Saves on every change** — calls `setItem(id, messages)` on each new message and streamed chunk, through an ordered write queue. -- **Clears on `clear()`** — calls `removeItem(id)`. +- **Hydrates on construction** — calls `getItem(threadId)` and populates itself (overriding `initialMessages`). +- **Saves on every change** — calls `setItem(threadId, state)` on each new message and streamed chunk, through an ordered write queue. +- **Clears on `clear()`** — calls `removeItem(threadId)`. ## Try it -Create a client, chat, then construct a **brand-new** client with the same `id` — it hydrates the full history from Redis with no `initialMessages`: +Create a client, chat, then construct a **brand-new** client with the same `threadId` — it hydrates the full history from Redis with no `initialMessages`: ```typescript // Session 1 — persists to Redis -const a = new ChatClient({ id: "demo", connection, persistence: upstashPersistence({ redis }) }); +const a = new ChatClient({ threadId: "demo", connection, persistence: upstashPersistence({ redis }) }); await a.sendMessage("In one short sentence, what is Upstash Redis?"); await a.sendMessage("And in one sentence, what is TanStack?"); -// Session 2 — same id, fresh client, no initialMessages -const b = new ChatClient({ id: "demo", connection, persistence: upstashPersistence({ redis }) }); +// Session 2 — same threadId, fresh client, no initialMessages +const b = new ChatClient({ threadId: "demo", connection, persistence: upstashPersistence({ redis }) }); await b.sendMessage("What did I ask you first? Quote it back."); // -> 'You asked: "In one short sentence, what is Upstash Redis?"' ``` diff --git a/search/sdks/ts/getting-started.mdx b/search/sdks/ts/getting-started.mdx index 3f789a606..ad54ff963 100644 --- a/search/sdks/ts/getting-started.mdx +++ b/search/sdks/ts/getting-started.mdx @@ -111,7 +111,7 @@ The Search SDK supports defining your content and metadata types at the index le ```typescript {4,5,6} import { Search } from "@upstash/search"; -const client = new Search(); +const client = Search.fromEnv(); type Content = { title: string, genre: string }; type Metadata = { year: number }; diff --git a/workflow/agents/features.mdx b/workflow/agents/features.mdx index 59261bcc7..40a137759 100644 --- a/workflow/agents/features.mdx +++ b/workflow/agents/features.mdx @@ -92,7 +92,7 @@ This flexibility allows you to tailor the tools to your specific needs while lev ```ts WorkflowTool (custom) -import { WorkflowTool } from '@upstash/workflow' +import { WorkflowTool } from '@upstash/workflow-agents' import { z } from 'zod' import * as mathjs from 'mathjs' diff --git a/workflow/basics/client/trigger.mdx b/workflow/basics/client/trigger.mdx index dac1ee738..debd12d7a 100644 --- a/workflow/basics/client/trigger.mdx +++ b/workflow/basics/client/trigger.mdx @@ -106,7 +106,7 @@ const { workflowRunId } = await client.trigger({ workflowRunId: "my-workflow", // optional workflow run id retries: 3, // optional retries retryDelay: "1000 * (1 + retried)", // optional delay between retries - delay: "10s" // optional delay value + delay: "10s", // optional delay value failureUrl: "https://", // optional failure url flowControl: { // optional flow control key: "USER_GIVEN_KEY", diff --git a/workflow/examples/authWebhook.mdx b/workflow/examples/authWebhook.mdx index 512fb5d77..4b0502040 100644 --- a/workflow/examples/authWebhook.mdx +++ b/workflow/examples/authWebhook.mdx @@ -93,9 +93,13 @@ export const { POST } = serve(async (context) => { }); async function sendProblemSolvedEmail({ - context: WorkflowContext - email: string, - stats: { totalProblemsSolved: number } + context, + email, + stats, +}: { + context: WorkflowContext; + email: string; + stats: { totalProblemsSolved: number }; }) { if (stats.totalProblemsSolved === 0) { await context.run("send no answers email", async () => { @@ -437,9 +441,13 @@ The `sendProblemSolvedEmail` method: ```typescript TypeScript async function sendProblemSolvedEmail({ - context: WorkflowContext - email: string, - stats: { totalProblemsSolved: number } + context, + email, + stats, +}: { + context: WorkflowContext; + email: string; + stats: { totalProblemsSolved: number }; }) { if (stats.totalProblemsSolved === 0) { await context.run("send no answers email", async () => { diff --git a/workflow/examples/paymentRetry.mdx b/workflow/examples/paymentRetry.mdx index fcb714d12..50087f29f 100644 --- a/workflow/examples/paymentRetry.mdx +++ b/workflow/examples/paymentRetry.mdx @@ -35,7 +35,7 @@ export const { POST } = serve(async (context) => { // attempt to charge the user const result = await context.run("charge customer", async () => { try { - return await chargeCustomer(i + 1), + return await chargeCustomer(i + 1) } catch (e) { console.error(e); return diff --git a/workflow/features/dlq/delete.mdx b/workflow/features/dlq/delete.mdx index f7c5018d7..b961b06cf 100644 --- a/workflow/features/dlq/delete.mdx +++ b/workflow/features/dlq/delete.mdx @@ -19,7 +19,7 @@ You can delete entries individually, in bulk by IDs, or by using filters such as await client.dlq.delete(["dlq-12345", "dlq-67890"]); // delete by filters - await client.dlq.delete({ label: "my-label" }); + await client.dlq.delete({ filter: { label: "my-label" } }); // delete all await client.dlq.delete({ all: true }); diff --git a/workflow/features/failureFunction/advanced.mdx b/workflow/features/failureFunction/advanced.mdx index 54327fbb3..9ccb6e265 100644 --- a/workflow/features/failureFunction/advanced.mdx +++ b/workflow/features/failureFunction/advanced.mdx @@ -21,7 +21,7 @@ If you think this advanced option fits your need, you can configure it by passin const client = new Client({ token: "" }) const { workflowRunId } = await client.trigger({ - url: "https:///workflow" + url: "https:///workflow", failureUrl: "https:///workflow-failure" }) ``` diff --git a/workflow/features/flow-control.mdx b/workflow/features/flow-control.mdx index 7b2bc8c15..34f3c0c24 100644 --- a/workflow/features/flow-control.mdx +++ b/workflow/features/flow-control.mdx @@ -96,7 +96,7 @@ export const { POST } = serve(async (context) => { await context.run( "charge customer", - () => chargeCustomer(), + () => chargeCustomer("customer-id"), { flowControl: { key: "payment-provider", parallelism: 3 }, } diff --git a/workflow/features/invoke.mdx b/workflow/features/invoke.mdx index 77bec022e..c48e8faa9 100644 --- a/workflow/features/invoke.mdx +++ b/workflow/features/invoke.mdx @@ -18,7 +18,7 @@ const { { workflow: analyzeContent, body: "test", - header: {...}, // headers to pass to anotherWorkflow (optional) + headers: {...}, // headers to pass to anotherWorkflow (optional) retries, // number of retries (optional, default: 3) flowControl, // flow control settings (optional) workflowRunId // workflowRunId to set (optional) diff --git a/workflow/features/invoke/serveMany.mdx b/workflow/features/invoke/serveMany.mdx index 56358f873..7fe1a5b94 100644 --- a/workflow/features/invoke/serveMany.mdx +++ b/workflow/features/invoke/serveMany.mdx @@ -38,7 +38,7 @@ This way, you can invoke a workflow simply by passing the object to `context.inv workflow: workflowOne, body: "user-1" } - ), + ); }); ``` @@ -80,7 +80,7 @@ This way, you can invoke a workflow simply by passing the object to `context.inv // 👇 optionally label the invoked run; single string or array label: ["team-a", "high-priority"], } - ), + ); }); ``` diff --git a/workflow/features/retries.mdx b/workflow/features/retries.mdx index 4bcd866b4..0101cdea4 100644 --- a/workflow/features/retries.mdx +++ b/workflow/features/retries.mdx @@ -19,7 +19,7 @@ By default, the retry count is set to **3**, and an **exponential backoff** dela ```javascript Default Backoff Algorithm // n = how many times this request has been retried -delay = min(86400, e ** (2.5*n)) // in seconds +delay = Math.min(86400, Math.E ** (2.5*n)) // in seconds ``` | Retry Attempt | Algorithm | Delay |