> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anny.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect HRworks with anny

> Cancel bookings on absence automatically and create absences from bookings in HRworks.

[HRworks](https://www.hrworks.de/) is a cloud-based HR software for personnel management, time tracking, and absence management. With the integration, anny can detect absences and sick notes from HRworks and react to them.

With HRworks, you can in anny:

* Automatically cancel bookings when employees are marked as absent in HRworks
* Create absences in HRworks when employees book specific resources in anny (for example, home office)
* Configure absence rules individually per absence type and resource

The integration is especially handy when your team manages hybrid workspaces through anny and absences are maintained centrally in HRworks.

## Typical use cases

| Use case                             | Description                                                                                                                                                               |
| :----------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Automatic cancellation on sick leave | **Bookings are cancelled automatically when a sick note exists in HRworks.** Employees don't have to cancel bookings manually, and blocked resources are freed up.        |
| Track home office days               | **Bookings of a specific resource automatically create an absence in HRworks.** This way, home office days are recorded in the HR system, without maintaining data twice. |
| Vacation with resource release       | **On approved vacation in HRworks, all bookings within the vacation period are cancelled.** Meeting rooms and desks become available for other employees.                 |

## How the HRworks connection works

Authentication runs via an API key pair (access key and secret access key) that you generate in HRworks. This authorizes anny to read personal master data, absences, and sick notes, and to create and delete absences and sick notes. anny does not access other HRworks data (for example, salaries or documents).

anny matches employees via the email address: every person in HRworks needs the same email address as their anny account. People without a matching email address are ignored.

| Data                                         | Direction      | Frequency                                        |
| -------------------------------------------- | -------------- | ------------------------------------------------ |
| Absences and sick notes (cancellation rules) | HRworks → anny | Hourly (automatic) or manual                     |
| Absences and sick notes (creation rules)     | anny → HRworks | On booking, change, and cancellation (immediate) |

<Warning>
  Synchronization only checks absences that start on the current day. Future absences (for example, a vacation next week) are only detected and processed on the relevant day, not in advance.
</Warning>

## Connect HRworks

### Requirements

Before you connect HRworks, make sure you have the following:

* In HRworks: admin access with permission to create an API key pair under **Basics > Integrations > HRworks API**
* In HRworks: read permission for the `/v2/persons/master-data` endpoint, so anny can map personnel numbers to your employees' email addresses
* In anny: admin role in the organization

<Warning>
  Without read permission for `/v2/persons/master-data`, anny cannot map absences to any customer. Automatic cancellation of bookings then does not work.
</Warning>

### Set up the connection

<Steps>
  <Step title="Open the integration">
    Open **Integrations** from the sidebar and go to **HRworks**.
  </Step>

  <Step title="Generate a key pair in HRworks">
    Log in to HRworks and navigate to **Basics > Integrations > HRworks API > Key pairs tab**.

    1. Click **New key pair**
    2. Choose the **Default** template from the dropdown menu
    3. Download the text file with the access key and secret access key
  </Step>

  <Step title="Verify authentication in anny">
    In anny, enter the access key into the **Client ID** field and the secret access key into the **Client Secret** field. Then click **Verify authentication**.
  </Step>

  <Step title="Configure rules">
    After successful authentication, set up the rules you want (see Settings & options).
  </Step>
</Steps>

Once the connection is active, you can configure cancellation rules and absence creation rules.

### Settings & options

The HRworks integration offers two rule types that are configured independently of each other.

#### Cancellation of bookings through absences

Define which absence types cancel bookings automatically. Only confirmed bookings are cancelled; the cancellation applies even after a cancellation deadline has passed, and the name of the absence type appears as the cancellation reason in the activity log.

<Steps>
  <Step title="Add a new rule">
    In the **Cancellation of bookings through absences** section, click **Add**.
  </Step>

  <Step title="Select the absence types">
    Choose one or more absence types from HRworks (for example, sick leave, vacation). Sick note types are also available in the list.
  </Step>

  <Step title="Add a restriction (optional)">
    Without a restriction, the rule applies to all resources. Via **Add restriction**, you can limit the rule to a specific resource, group, or category. A rule on a resource with sub-resources applies to its sub-resources.
  </Step>

  <Step title="Confirm">
    Save the rule with **Confirm**. With **Synchronize**, you can trigger synchronization immediately, otherwise it runs automatically every hour.
  </Step>
</Steps>

<Tip>
  By default, the **Only cancel accepted absences** switch is active: anny then cancels only on approved absences. Turn off the switch if unapproved absence requests should also cancel bookings.
</Tip>

#### Automatic creation of absences

Define which resource booking automatically creates an absence in HRworks. The absence is created as soon as the booking is confirmed, and appears in HRworks as a request with the status "requested" (sick notes with the status "reported"). It is not approved automatically.

<Steps>
  <Step title="Add a new rule">
    In the **Creation of absences through bookings** section, click **Add**.
  </Step>

  <Step title="Choose the trigger in anny">
    Choose the resource, group, or category whose booking should trigger an absence (for example, the "Home office" resource). If a resource has sub-resources, choose the parent resource: the rule then covers all sub-resources.
  </Step>

  <Step title="Choose the absence type in HRworks">
    Choose the absence type that should be created in HRworks (for example, "Home office").
  </Step>

  <Step title="Confirm">
    Save the rule with **Confirm**.
  </Step>
</Steps>

If you cancel the booking later, anny deletes the created absence in HRworks. If you reschedule or change the booking, the absence is recreated with the new data.

The absence takes the start and end date of the booking. The assignment to the half-day happens automatically:

| Booking time                                | Created absence        |
| ------------------------------------------- | ---------------------- |
| End time before 3:00 PM                     | First half of the day  |
| Start time from 12:00 PM                    | Second half of the day |
| Both (booking between 12:00 PM and 3:00 PM) | Second half of the day |

## Limitations

The HRworks integration does not support:

* Forward-looking checks: absences are only detected on the current day, not in advance (for example, no cancelling of vacations entered for next week)
* Real-time synchronization for cancellations: bookings are checked hourly, not in real time
* User matching without the personnel-number endpoint: without read permission for `/v2/persons/master-data`, anny cannot map absences
* Half-day cancellation: for cancellation, anny evaluates every absence as full-day. A half-day absence in the morning also cancels bookings in the afternoon of the same day
* Automatic approval: absences created in HRworks stay requests and go through the normal approval process in HRworks

## Disconnect

<Warning>
  If you deactivate the integration, no new synchronizations are performed. Existing rules stay saved but inactive. When you delete, all rules and the connection configuration are removed. Absences already created in HRworks remain in both cases.
</Warning>

You can do both under **Integrations**: deactivate via the **toggle** in the top right, delete via the **three dots** → **Delete**.

## FAQ

<AccordionGroup>
  <Accordion title="How often does anny sync absences from HRworks?">
    Synchronization runs automatically once an hour. You can trigger it manually at any time via the **Synchronize** button, as long as the integration is active.
  </Accordion>

  <Accordion title="Are future absences taken into account too?">
    No. The integration only checks absences that start on the current day. Future entries (for example, a vacation in two weeks) are only processed on their start day. Then anny cancels all bookings across the entire absence period.
  </Accordion>

  <Accordion title="What happens if an absence in HRworks is not yet approved?">
    By default, nothing: the **Only cancel accepted absences** switch is active, so anny cancels only on approved absences. If you turn off the switch, unapproved requests also lead to cancellation.
  </Accordion>

  <Accordion title="Can I limit cancellation to specific resources?">
    Yes. When creating a rule, you can add a restriction to specific resources, groups, or categories. Without a restriction, the rule applies to all resources.
  </Accordion>

  <Accordion title="What happens to the absence in HRworks when I cancel the booking?">
    anny deletes the automatically created absence in HRworks. If you reschedule the booking instead, the absence is recreated with the new data.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Bookings are not cancelled even though an absence is entered in HRworks">
    Most common cause: read permission for `/v2/persons/master-data` is missing in your HRworks API key pair. Without this permission, anny cannot map the personnel number to any email address and does not recognize the affected person. Check the API permissions in HRworks under **Basics > Integrations > HRworks API**. Also check whether the absence is already approved: by default, anny cancels only on approved absences.
  </Accordion>

  <Accordion title="Synchronization only cancels on a manual click">
    Check whether the integration is active (toggle in the top right on the integration page). If it is active, the sync runs automatically every hour. Note that only absences starting on the current day are checked.
  </Accordion>

  <Accordion title="The absence in HRworks is not created">
    The cause is usually the rule configuration or the matching. Make sure the rule covers the booked resource (for sub-resources, choose the parent resource) and the booking is confirmed. Also check whether the employee is registered in HRworks with the same email address as in anny.
  </Accordion>
</AccordionGroup>

> Important information for agents:
>
> * UI path: Sidebar > Integrations > HRworks. The anny UI writes the platform as "HRWorks", the vendor as "HRworks".
> * Exact UI terms: fields **Client ID** and **Client Secret**; buttons **Verify authentication**, **Add**, **Confirm**, **Add restriction**, **Synchronize**; toggle **Only cancel accepted absences** (active by default); rule tables with columns **Absence type** and **Restriction**. The second section is called "Creation of absences through bookings" in the UI (the article heading is "Automatic creation of absences").
> * Rule anatomy: cancellation rules allow multiple absence types per rule, creation rules exactly one type and mandatorily a resource/group/category.
> * User matching: anny loads personal master data (/v2/persons/master-data) and maps personnel numbers via exactly matching email addresses; the mapping is stored per customer. If the permission is missing, both cancellation AND creation fail.
> * Resource mapping (quirk): cancellation rules on a resource with sub-resources apply only to the sub-resources, not to bookings of the resource itself. For creation rules, the parent resource of the booked resource always counts; a rule directly on a sub-resource does not apply.
> * Cancellation: only confirmed bookings, bypasses cancellation deadlines (even after the deadline), cancellation reason = name of the absence type, the cause in the activity log is the integration. Absence periods are evaluated as full-day (half-day details from HRworks are ignored).
> * Sync window: the hourly job only checks absences starting today; when processing, though, bookings across the entire absence period are cancelled. The manual sync requires an active integration; in an error state, the automatic sync pauses.
> * Creation: only after booking confirmation (requests only after acceptance); status "requested", sick notes "reported". anny waits max. about 20 seconds for HRworks to process, otherwise the creation counts as failed.
> * Half-day logic exactly: end hour ≤ 14 (before 3:00 PM) → first half; start hour ≥ 12 → second half; both → second half. Flags apply to the first/last day of multi-day bookings.
> * Sick notes are a separate data type in HRworks; anny treats them like absences (own type list, own endpoints).
> * Distinction: no synchronization of attendances, time tracking, or other personnel data; no approval of requests in HRworks.
> * Related articles: Personio integration (same rule interface and functional logic, different authentication, OAuth-like API credentials there).
