Skip to content

ENGINEERING CASE STUDY · BUILT BY CLOUDHERO

HeyLeave: connecting natural language to dependable HR workflows.

CloudHero developed HeyLeave to connect employee conversations with HR requests, documents and approvals. The engineering centres on a clear boundary: the LLM interprets language; application rules decide which actions are permitted and how records change.

Workflow
Employee requests and HR operations
Technology
Amazon Bedrock · JavaScript · SQL · Document processing

THE CHALLENGE

A request in everyday language still needs a precise workflow.

Employees describe the same request in different languages and formats. Dates may be incomplete, documents need checking and approvals depend on the employee’s identity and the organisation’s rules. A fluent reply alone cannot establish that a request is valid or approved.

We built an AI integration that turns conversation into structured intent and hands that intent to a deterministic workflow engine. Identity, permissions, validation and record updates remain in application code. This gives the model a useful role without asking it to invent an employee’s balance or decide an approval.

WORKFLOW ARCHITECTURE

From employee message to a recorded decision.

  1. Interpret

    Bedrock returns a typed intent from the conversation.

  2. Validate

    The server checks identity, fields and business rules.

  3. Review

    The employee or HR team confirms the relevant details.

  4. Record

    The application commits the transition and builds the reply.

AMAZON BEDROCK

Structured interpretation through Amazon Bedrock.

The provider adapter invokes Anthropic models through the Amazon Bedrock runtime. An interpret_turn tool schema defines the accepted intent shapes. The interpreter checks the returned tool call, rejects malformed or ambiguous responses and validates the arguments before the workflow can use them.

The same integration supports multimodal document extraction. Extracted fields pass through a dedicated schema validator and enter a review flow. An extraction failure can lead to manual handling, rather than silently registering an incomplete document.

Model calls have deadlines and bounded retries, with distinct handling for authentication failures, throttling and upstream errors. Usage hooks capture token counts, latency and failures, and reserve spend before attempts. The application can therefore account for retries as part of operating the integration.

WHAT CLOUDHERO BUILT

Language flexibility with explicit business rules.

A workflow engine that owns the state

The domain layer checks roles, request fields and permitted transitions. Record changes happen in database transactions; asynchronous model calls run outside those transactions. A model response cannot directly change an approval state.

Translations checked against facts

Replies start with values from application records. Optional rephrasing and translation check selected facts such as dates, numbers, identifiers and names against the source. A failed or inconsistent response falls back to the trusted reply. These checks reduce specific errors; they are not a guarantee of perfect translation.

Document extraction with review

The document flow separates extraction, employee confirmation, HR correction and registration. Duplicate checks and review-version checks guard against repeated or stale submissions. The model proposes document fields; the application and reviewer control registration.

Policy answers tied to approved text

The policy flow uses a controlled catalogue of articles. Access depends on the user’s audience; selected article identifiers resolve to stored text and a citation. Policy wording comes from the maintained source rather than an unrestricted generated answer.

Business logic separated from its runtime and adapters.

The domain core accepts database, clock, model and integration dependencies through explicit interfaces. The reviewed implementation has Node/Express and Cloudflare Worker hosts, including a Durable Object SQLite adapter. Messaging and HR/payroll connectors can be exercised separately from the conversation and approval logic. This makes integration boundaries testable before connecting an external system.

What the implementation makes possible.

An employee can describe a request in natural language and receive a response tied to the application’s actual state. HR can review extracted document fields and complete an explicit approval or registration step. CloudHero’s contribution joins the LLM adapter, multilingual conversation, document handling, business rules and transactional workflow into one application.

This approach is relevant wherever a conversational interface touches controlled records: employee services, document intake, internal service desks and approval processes. The important design work is defining the intent, validation, review and failure path for each action.

YOUR AI PROJECT

Have a workflow you want to improve with AI?

Start with the data, systems and permitted actions. We help define what is worth building and the implementation plan around it.

Plan your AI implementation

Contact CloudHero

Tell us what you're working on

Our sales team replies by email within 1 business day.

Topic

We use your details only to reply. Privacy policy