Skip to content

feat: Batch tasks documentation - #4586

Merged
juliusgeo merged 4 commits into
mainfrom
batch_docs
Jul 31, 2026
Merged

feat: Batch tasks documentation#4586
juliusgeo merged 4 commits into
mainfrom
batch_docs

Conversation

@juliusgeo

@juliusgeo juliusgeo commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation change (pure documentation change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking changes to code which doesn't change any behaviour)
  • CI (any automation pipeline changes)
  • Chore (changes which are not directly related to any business logic)
  • Test changes (add, refactor, improve or change a test)
  • This change requires a documentation update

What's Changed

  • Add a list of tasks or features here...

Checklist

Changes have been:

  • Tested (unit, integration, or manually with steps specified)
  • Linted and formatted
  • Documented (where applicable)
  • Added to CHANGELOG (where applicable) -- see Keep a Changelog

🤖 AI Disclosure
  • I acknowledge that an LLM was used in the creation of this Pull Request, in accordance with Hatchet's AI_POLICY.md.
  • Details: [e.g. generating tests, writing docs]

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview Jul 31, 2026 4:30pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation sdk-ts Related to the Typescript SDK sdk-go Related to the Go SDK sdk-py Related to the Python sdk labels Jul 31, 2026

@mrkaye97 mrkaye97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a couple small comments!

import { Snippet } from "@/components/code";
import UniversalTabs from "../../components/UniversalTabs";

# Batch Tasks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit - we say Batch here and Batched in the side bar

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

Comment thread frontend/docs/pages/v1/batch-tasks.mdx Outdated
Comment on lines +17 to +18
the batched execution is hidden. It is called, and receives outputs, in the same
manner as a normal task.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you mean by this, but the wording is a little confusing - could use a simple example to explain (not necessarily code, just one more sentence)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

Comment thread frontend/docs/pages/v1/batch-tasks.mdx Outdated
- The maximum interval has elapsed since the last batch flush.
- The size of the payloads for the buffered tasks has exceeded the 4Mb gRPC message limit.

In the following example, the batch task will be executed once 10 tasks have accumulated, or every 200ms, whichever comes first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like these examples use 3 as the max size, not 10 (btw, better tooling for this would be amazing, it's hard to keep text and code in sync)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, fixed!

/>
</Tabs.Tab>
</UniversalTabs>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section on keys could use another sentence or two to explain why you might want to do that - also might reword a bit to reinforce the idea that this is basically a partition key

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense--fixed

## Broadcasting outputs

In the default case, batch outputs are mapped 1-1 back to the callers. So if you called a batch task with input `a` and `b` at separate
call sites, you would receive back outputs `a'` and `b'` respectively, despite the fact they would both be executed at the same time, in the same handler.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very Haskelly, using a' and b' 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 I was inspired by vector transformations, but yes

@juliusgeo
juliusgeo merged commit 2ff0b1b into main Jul 31, 2026
45 of 48 checks passed
@juliusgeo
juliusgeo deleted the batch_docs branch July 31, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation sdk-go Related to the Go SDK sdk-py Related to the Python sdk sdk-ts Related to the Typescript SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants