# Notifications service workflow overview

### Workflow overview

The notification service receives a request to create a notification, the service processes the request and places it in a AWS SQS.&#x20;

#### Message processing

A worker periodically requests notifications from the **AWS SQS** queue in batches of up to 10 messages.

The worker handler fetches data needed to send out the notification, the template from Contentful and user specific information and tokens from the user profile service. Then proceeds to send the notification to the appropriate channel (e.g., push notification via Firebase Cloud Messaging, or email).

### Error Handling and Retries

* **Retry Logic**:\
  If a message fails during processing, the system automatically retries up to **three times**.
* **Dead Letter Queue (DLQ)**:\
  If a message fails after the maximum number of retries, it is moved to a **Dead Letter Queue**. Messages in the DLQ are not processed automatically and require **manual intervention** to reprocess.

### Debugging and monitoring

* **Message Tracking**:\
  Each message is assigned a unique `messageId`, which can be used to trace its lifecycle within the system.
* **Logging**:\
  Logs for message processing are available in **Datadog**.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devland.is/products/notifications-hnipp/notifications-service-workflow-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
