Skip to main content

Get Resource Block Action

The Get Resource Block action retrieves a single resource block (user event with event_id set to blocked_dates) by its ID.

Jerome Bajou avatar
Written by Jerome Bajou
Updated this week

Overview

The Get Resource Block action retrieves a single resource block (user event with event_id set to blocked_dates) by its ID. Use this to fetch details of a specific block, verify its existence, or access its properties in subsequent workflow steps.


Configuration

User Event ID (Required)

The ID of the user event (resource block) to retrieve. Must be a valid user event ID that:

  • Has event_id set to blocked_dates

  • Belongs to a user in the same business unit as the workflow

Supports variables from the workflow context.

Example:

{user_event.id}

or

123

Output

Returns the resource block object in the workflow context with all block details:

  • id - User event ID

  • user_id - ID of the user who owns the block

  • event_id - Event ID (always blocked_dates for blocks)

  • summary - Summary text of the block

  • start - Start date and time (ISO8601 format)

  • end - End date and time (ISO8601 format)

  • bookable_type - Type of schedule (if block is for a specific schedule)

  • bookable_id - ID of the schedule (if block is for a specific schedule)

  • calendar_id - Google Calendar ID (if synced to Google Calendar)

  • created_at - Creation timestamp

  • updated_at - Last update timestamp

Accessing Resource Block Data

After this action, you can access:

{user_event.id} 
{user_event.user_id}
{user_event.event_id}
{user_event.summary}
{user_event.start}
{user_event.end}
{user_event.bookable_type}
{user_event.bookable_id}
{user_event.calendar_id}
{user_event.created_at}
{user_event.updated_at}

Examples

1. Get Block from Context Variable

User Event ID: {user_event.id}

Retrieves the block referenced by a user event from a previous workflow step (e.g., from Block Resource action).

2. Get Block by Direct ID

User Event ID: 456

Retrieves the block with ID 456 (if it belongs to a user in the same business unit).

3. Get Block from Find Results

User Event ID: {resource_blocks[0].id}

Retrieves the first block from a previous Find Resource Blocks action.


Validation

The action validates:

  • User Event ID is required and not empty

  • User event exists in the system

  • User event has event_id set to blocked_dates

  • User owning the event belongs to the same business unit as the workflow

If any validation fails, an InvalidArgumentException is thrown.


Best Practices

  1. Verify existence first - Use Find Resource Blocks to check if a block exists before getting it

  2. Use variables - Reference blocks from previous workflow steps using context variables

  3. Handle errors - Set up error notifications for cases where blocks cannot be found

  4. Check business unit - Remember that blocks are automatically scoped to your workflow's business unit

  5. Access properties safely - Check if optional fields (like bookable_type or calendar_id) exist before using them

  6. Use in workflows - Combine with Remove Resource Block to conditionally remove blocks based on their properties


Related Documentation

Did this answer your question?