Skip to main content

Request

Register a service to identify and group related functions and triggers under a named service.

Response

This message typically does not have a dedicated response. The service registration is acknowledged by the framework and the service becomes available for function and trigger registration.

Examples

Basic Service Registration

{
  "type": "registerservice",
  "id": "payment_service",
  "name": "Payment Service"
}

Service with Description

{
  "type": "registerservice",
  "id": "notification_service",
  "name": "Notification Service",
  "description": "Handles all user notifications including email, SMS, and push notifications"
}

Microservice Registration

{
  "type": "registerservice",
  "id": "analytics.events",
  "name": "Analytics Events Service",
  "description": "Processes and aggregates user analytics events"
}

Error Cases

Duplicate Service ID

Attempting to register a service with an ID that’s already registered will fail. Unregister the existing service first or use a different ID.

Invalid Service ID Format

Service IDs should follow naming conventions (typically alphanumeric with dots or underscores).

Notes

  • Service IDs must be unique within a worker session
  • Services provide logical grouping and organization for functions and triggers
  • The description field is optional and omitted from serialization when not provided
  • Registering a service does not automatically register any functions or triggers
  • Functions and triggers can reference the service ID in their metadata
  • Services help organize and manage related functionality in distributed systems

Build docs developers (and LLMs) love