kestra-io / kestra-io/plugin-anthropic
New task: MessageBatch (create / poll / retrieve / cancel)
- Dominant language
- Java
- Stars
- 0
- Forks
- 4
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 3
Description
Part of #75.
## What
Add a `MessageBatch` task to submit, poll, and retrieve Anthropic Message Batches — the async batch API that delivers 50% cost savings. This is a natural fit for Kestra orchestration: create the batch, wait (with a polling sub-flow or a `WaitFor`), then retrieve results.
## Suggested design
Three modes (or three separate tasks):
- **`CreateBatch`**: accepts a list of `BatchRequest` (custom_id + `ChatCompletion`-like params); returns `batchId`.
- **`RetrieveBatch`** / **`PollBatch`**: takes `batchId`; returns status (`in_progress` | `ended`) and, when ended, the result file URL or a list of per-request outputs.
- **`CancelBatch`**: takes `batchId`.
Alternatively, a single `MessageBatch` task with a `mode` enum property.
## Output
- `batchId`, `status`, `requestCounts` (processing / succeeded / errored / canceled / expired).
- When `mode = retrieve` and status is `ended`: `results` list mirroring `ChatCompletion.Output` per request.
## References
- Anthropic Batch API docs
- SDK: `client.messages().batches().*`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Anthropic Batch API documentation and the SDK entry points named in the issue: client.messages().batches().*. Define the create, poll or retrieve, and cancel scope, then verify that the outputs cover batchId, status, requestCounts, and ended-batch results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100