resonate-human-in-the-loop-pattern-java

resonate-human-in-the-loop-pattern-java is a skill for Claude Code, Codex from resonatehq/resonate-skills. It costs 144 tokens per session (2,512 once invoked), scanned A, original, Apache-2.0.

A Java pattern for workflows that pause until a person or another outside system supplies a decision or result. The workflow can resume after that response arrives, even after a crash or restart.

In plain words
What is it for?
Use it for approval steps, reviews, confirmations, or other processes where an external actor must resolve a waiting request from Java code.
Why use it?
It removes the need to keep a worker running while waiting for human input. The workflow's waiting state and later continuation are handled durably.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for approval steps, reviews, confirmations, or other processes where an external actor must resolve a waiting request from Java code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add resonatehq/resonate-skills --skill resonate-human-in-the-loop-pattern-java
Clone the repo
git clone --depth 1 https://github.com/resonatehq/resonate-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for resonate-human-in-the-loop-pattern-java

README.md
[![agentmods](https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java/github.svg)](https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java)
Your own site
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for resonate-human-in-the-loop-pattern-java

Your own site · 80×15
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-java.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 144 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,512 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00144 $0.02512
Opus 5 $0.00072 $0.01256
Sonnet 5 $0.00029 $0.00502
Haiku 4.5 $0.00014 $0.00251

Measured 10d ago against content hash fc0c6495fb5c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

resonate-human-in-the-loop-pattern-java scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST "http://localhost:8001/promises/${APPROVAL_ID}/resolve" \
resonate-human-in-the-loop-pattern-java/SKILL.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Resonate Human-in-the-Loop Pattern — Java

Prerelease note. resonate-sdk-java is published on Maven Central — pin io.resonatehq:resonate-sdk-java:0.1.1. The API mirrors the Python SDK and may change before a stable 1.0. Requires Java 21+ (virtual threads, a feature generally available in Java 21). There is no Java HITL example repo yet, so every code block here uses only documented SDK surface, compile-verified against 0.1.1 and cross-checked against develop/java.mdx (docs PR #230) and the SDK source.

Overview

For the language-agnostic mental model, start with resonate-human-in-the-loop-pattern-typescript. The idea is identical: create a latent durable promise, hand its ID to the external actor who will settle it, and await — the workflow parks until settlement arrives, surviving any number of crashes or restarts.

Resolution from Java is direct. The Java SDK ships a top-level r.promises sub-client (it mirrors Python), so settling a promise from outside the workflow is r.promises.resolve(id, new Value(...)). There is no manual base64 encoding — that extra step is a Go-specific workaround for a sub-client Go lacks. Don't copy it into Java.

When to use

  • Approval gates (budget, deploy, content moderation)
  • Third-party webhook callbacks (Stripe, DocuSign, Twilio)
  • Operator unblock steps in runbooks
  • Any step where the decision or data originates outside the Resonate worker set

Basic shape

Workflow side — ctx.promise()promise.id() → publish → await

import io.resonatehq.resonate.Context;
import io.resonatehq.resonate.Context.ResonateFuture;
import java.time.Duration;

public final class Approval {
    private Approval() {}

    public record ReviewRequest(String item, String requester) {}

    /**
     * Parks until an external actor settles the latent promise. promise.id() returns the id once
     * the promise has been created (instantaneous in local mode, a network round-trip against a
     * real server); await suspends the workflow (durably) until it is settled from outside.
     */
    public static String approvalWorkflow(Context ctx, ReviewRequest req) {
        // A latent durable promise — no registered function backs it; it settles only when an
        // external caller resolves it. 24-hour timeout, capped at the workflow deadline.
        ResonateFuture<Object> promise = ctx.promise(Duration.ofHours(24));
        String approvalId = promise.id();

        // Publish the promise ID inside a ctx.run so the side effect is checkpointed and does
        // not re-run on replay. In production: write to a DB, push to a notification queue, etc.
        ctx.run(Approval::publishApprovalId, req.item(), approvalId).await();

        // Suspend until the promise is settled externally; decode the decision.
        Object decision = promise.await();
        return "item " + req.item() + " decided: " + decision;
    }

    /** Checkpointed publication of the promise ID. Replace the println with a real notification. */
    public static String publishApprovalId(Context ctx, String item, String approvalId) {
        System.out.printf("  [workflow] awaiting approval for %s — promise id: %s%n", item, approvalId);
        return "published";
    }
}

Read the full file on GitHub · 152 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 152 lines · 144 tokens per session scan A fc0c6495fb5c

Subscribe to this mod's changes

resonate-human-in-the-loop-pattern-java is a skill published in the GitHub repository resonatehq/resonate-skills (6 stars, last pushed 18d ago), licensed Apache-2.0. It adds 144 tokens to every session and 2,512 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

springboot-patterns

Provides Spring Boot architecture patterns for REST APIs, layered services, JPA data access, caching, async processing, and logging. Use when working with Java Spring Boot files (.java, pom.xml) or when the user mentions Spring Boot, Spring Framework, or Java backend.

tranhieutt/software_development_department · 59 tokens

azure-security-keyvault-secrets-java

Azure Key Vault Secrets Java SDK for secret management. Use when storing, retrieving, or managing passwords, API keys, connection strings, or other sensitive configuration data.

microsoft/skills · 40 tokens

azure-ai-anomalydetector-java

Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate/multivariate anomaly detection, time-series analysis, or AI-powered monitoring.

microsoft/skills · 43 tokens

azure-communication-common-java

Azure Communication Services common utilities for Java. Use when working with CommunicationTokenCredential, user identifiers, token refresh, or shared authentication across ACS services.

microsoft/skills · 35 tokens

union-type-wrappers

Add typed getters and setters over BinaryData properties that represent TypeSpec union types in generated Java models. Use when generated classes expose BinaryData for union-typed fields and you need ergonomic, type-safe accessors instead.

Azure/azure-sdk-for-java · 49 tokens

azure-ai-agents-persistent-java

Azure AI Agents Persistent SDK for Java. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Triggers: "PersistentAgentsClient", "persistent agents java", "agent threads java", "agent runs java", "streaming agents java".

microsoft/skills · 63 tokens