[PR #587] [CLOSED] feat(server): support simple webhook #8681

Closed
opened 2026-02-05 13:51:26 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/587
Author: @panoti
Created: 9/5/2022
Status: Closed

Base: mainHead: refactor/rest-to-pubsub


📝 Commits (10+)

  • bfb09cb feat(machine-learning): make sure job queues finished before closing
  • efdc140 refactor(machine-learning): add queues, interfaces, constants.
  • d7d1265 refactor(machine-learning): trigger image classfication and object detection
  • 40eaa7d chore(machine-learning): remove gracefull shutdown out of code
  • d776dff refactor(server): using mlClient
  • 3d0f896 fix(server): configs
  • 87aa12a chore(ml): add symlink to entities dir
  • acdec6f chore(ml): duplicate entities for testing
  • 6c726a0 build(ml): add joi pkg
  • e69dc80 chore(ml): revert main

📊 Changes

27 files changed (+1527 additions, -73 deletions)

View changed files

📝 docker/.env.example (+8 -1)
📝 docker/.env.test (+4 -1)
📝 machine-learning/package-lock.json (+853 -12)
📝 machine-learning/package.json (+7 -0)
machine-learning/src/app.controller.ts (+35 -0)
📝 machine-learning/src/app.module.ts (+40 -7)
machine-learning/src/config/app.config.ts (+18 -0)
📝 machine-learning/src/config/database.config.ts (+1 -0)
machine-learning/src/config/index.ts (+2 -0)
machine-learning/src/constants/queue-name.constant.ts (+2 -0)
machine-learning/src/dto/webhook-payload.dto.ts (+25 -0)
machine-learning/src/entities/asset.entity.ts (+66 -0)
machine-learning/src/entities/exif.entity.ts (+101 -0)
machine-learning/src/entities/smart-info.entity.ts (+22 -0)
machine-learning/src/interfaces/image-classification-job.interface.ts (+11 -0)
machine-learning/src/interfaces/index.ts (+2 -0)
machine-learning/src/interfaces/object-detection-job.interface.ts (+11 -0)
📝 machine-learning/src/main.ts (+2 -4)
machine-learning/src/processors/image-classification.processor.ts (+72 -0)
machine-learning/src/processors/object-detection.processor.ts (+66 -0)

...and 7 more files

📄 Description

Webhook can help everybody can trigger a zapier, n8n pipline easier. We can implement some external tasks (eg: Geolocation interpolation, Face recognization) as plugins/addons by using webhook.

  • Remove hard-code http://immich-machine-learning:3003/image-classifier/tag-image and http://immich-machine-learning:3003/object-detection/detect-object away from worker service. Machine learning service is standalone now. Everyone can launch it only when necessary.
  • Create webhook interface POST <WEBHOOK_URL> with payload:
{
  "type": "AssetCreationEvent",
  "asset": {
    "id": "assetId",
    ...
  }
}
  • Create api POST /webhook on ml service to received webhook request from immich server.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/587 **Author:** [@panoti](https://github.com/panoti) **Created:** 9/5/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `refactor/rest-to-pubsub` --- ### 📝 Commits (10+) - [`bfb09cb`](https://github.com/immich-app/immich/commit/bfb09cb416821830ac34e50e5c485bd7b5883e35) feat(machine-learning): make sure job queues finished before closing - [`efdc140`](https://github.com/immich-app/immich/commit/efdc1408be89acd0b1ca50e6dac8b2a9cd605dbe) refactor(machine-learning): add queues, interfaces, constants. - [`d7d1265`](https://github.com/immich-app/immich/commit/d7d1265cd6c3017450b9bb03b91da25eb6160ab0) refactor(machine-learning): trigger image classfication and object detection - [`40eaa7d`](https://github.com/immich-app/immich/commit/40eaa7dfccc964bf2931d694efcfc33f3142d023) chore(machine-learning): remove gracefull shutdown out of code - [`d776dff`](https://github.com/immich-app/immich/commit/d776dff200286050e89bcaf22e37eb1b5b19f037) refactor(server): using mlClient - [`3d0f896`](https://github.com/immich-app/immich/commit/3d0f896b1e31d208a5795581f4e0ab6fcdc17de4) fix(server): configs - [`87aa12a`](https://github.com/immich-app/immich/commit/87aa12a310ad25745d3f2bca374899c4135693b9) chore(ml): add symlink to entities dir - [`acdec6f`](https://github.com/immich-app/immich/commit/acdec6fb55a84b6d607aafd59477fafe1342dd1a) chore(ml): duplicate entities for testing - [`6c726a0`](https://github.com/immich-app/immich/commit/6c726a05b216f867f7f81148f81464836758372e) build(ml): add joi pkg - [`e69dc80`](https://github.com/immich-app/immich/commit/e69dc80786f51ef34845eedba313f2fa136a51d7) chore(ml): revert main ### 📊 Changes **27 files changed** (+1527 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `docker/.env.example` (+8 -1) 📝 `docker/.env.test` (+4 -1) 📝 `machine-learning/package-lock.json` (+853 -12) 📝 `machine-learning/package.json` (+7 -0) ➕ `machine-learning/src/app.controller.ts` (+35 -0) 📝 `machine-learning/src/app.module.ts` (+40 -7) ➕ `machine-learning/src/config/app.config.ts` (+18 -0) 📝 `machine-learning/src/config/database.config.ts` (+1 -0) ➕ `machine-learning/src/config/index.ts` (+2 -0) ➕ `machine-learning/src/constants/queue-name.constant.ts` (+2 -0) ➕ `machine-learning/src/dto/webhook-payload.dto.ts` (+25 -0) ➕ `machine-learning/src/entities/asset.entity.ts` (+66 -0) ➕ `machine-learning/src/entities/exif.entity.ts` (+101 -0) ➕ `machine-learning/src/entities/smart-info.entity.ts` (+22 -0) ➕ `machine-learning/src/interfaces/image-classification-job.interface.ts` (+11 -0) ➕ `machine-learning/src/interfaces/index.ts` (+2 -0) ➕ `machine-learning/src/interfaces/object-detection-job.interface.ts` (+11 -0) 📝 `machine-learning/src/main.ts` (+2 -4) ➕ `machine-learning/src/processors/image-classification.processor.ts` (+72 -0) ➕ `machine-learning/src/processors/object-detection.processor.ts` (+66 -0) _...and 7 more files_ </details> ### 📄 Description Webhook can help everybody can trigger a `zapier`, `n8n` pipline easier. We can implement some external tasks (eg: [Geolocation interpolation](https://github.com/immich-app/immich/issues/566), [Face recognization](https://github.com/immich-app/immich/issues/294)) as plugins/addons by using webhook. - [x] Remove hard-code `http://immich-machine-learning:3003/image-classifier/tag-image` and `http://immich-machine-learning:3003/object-detection/detect-object` away from worker service. Machine learning service is standalone now. Everyone can launch it only when necessary. - [x] Create webhook interface `POST <WEBHOOK_URL>` with payload: ```json { "type": "AssetCreationEvent", "asset": { "id": "assetId", ... } } ``` - [x] Create api `POST /webhook` on ml service to received webhook request from immich server. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:51:26 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#8681