Skip to content

Commit 0f2364d

Browse files
Merge pull request #1020 from roboflow/feature/add_option_to_specify_bp_webhook
Add changes to make it possible to register WebHooks
2 parents 84f6b62 + 43b75fb commit 0f2364d

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

inference_cli/lib/roboflow_cloud/batch_processing/api_operations.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ def trigger_job_with_workflows_images_processing(
337337
max_parallel_tasks: Optional[int],
338338
aggregation_format: Optional[AggregationFormat],
339339
job_id: Optional[str],
340+
notifications_url: Optional[str],
340341
api_key: Optional[str],
341342
) -> str:
342343
workspace = get_workspace(api_key=api_key)
@@ -369,6 +370,7 @@ def trigger_job_with_workflows_images_processing(
369370
processing_timeout_seconds=max_runtime_seconds,
370371
max_parallel_tasks=max_parallel_tasks,
371372
processing_specification=processing_specification,
373+
notifications_url=notifications_url,
372374
)
373375
create_batch_job(
374376
workspace=workspace,
@@ -394,6 +396,7 @@ def trigger_job_with_workflows_videos_processing(
394396
aggregation_format: Optional[AggregationFormat],
395397
max_video_fps: Optional[Union[float, int]],
396398
job_id: Optional[str],
399+
notifications_url: Optional[str],
397400
api_key: Optional[str],
398401
) -> str:
399402
workspace = get_workspace(api_key=api_key)
@@ -427,6 +430,7 @@ def trigger_job_with_workflows_videos_processing(
427430
processing_timeout_seconds=max_runtime_seconds,
428431
max_parallel_tasks=max_parallel_tasks,
429432
processing_specification=processing_specification,
433+
notifications_url=notifications_url,
430434
)
431435
create_batch_job(
432436
workspace=workspace,

inference_cli/lib/roboflow_cloud/batch_processing/core.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ def process_images_with_workflow(
193193
help="Flag enabling errors stack traces to be displayed (helpful for debugging)",
194194
),
195195
] = False,
196+
notifications_url: Annotated[
197+
Optional[str],
198+
typer.Option(
199+
"--notifications-url",
200+
help="URL of the Webhook to be used for job state notifications.",
201+
),
202+
] = None,
196203
) -> None:
197204
if api_key is None:
198205
api_key = ROBOFLOW_API_KEY
@@ -211,6 +218,7 @@ def process_images_with_workflow(
211218
max_parallel_tasks=max_parallel_tasks,
212219
aggregation_format=aggregation_format,
213220
job_id=job_id,
221+
notifications_url=notifications_url,
214222
api_key=api_key,
215223
)
216224
print(f"Triggered job with ID: {job_id}")
@@ -324,6 +332,13 @@ def process_videos_with_workflow(
324332
help="Flag enabling errors stack traces to be displayed (helpful for debugging)",
325333
),
326334
] = False,
335+
notifications_url: Annotated[
336+
Optional[str],
337+
typer.Option(
338+
"--notifications-url",
339+
help="URL of the Webhook to be used for job state notifications.",
340+
),
341+
] = None,
327342
) -> None:
328343
if api_key is None:
329344
api_key = ROBOFLOW_API_KEY
@@ -343,6 +358,7 @@ def process_videos_with_workflow(
343358
aggregation_format=aggregation_format,
344359
max_video_fps=max_video_fps,
345360
job_id=job_id,
361+
notifications_url=notifications_url,
346362
api_key=api_key,
347363
)
348364
print(f"Triggered job with ID: {job_id}")

inference_cli/lib/roboflow_cloud/batch_processing/entities.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,7 @@ class WorkflowProcessingJobV1(BaseModel):
139139
processing_specification: WorkflowsProcessingSpecificationV1 = Field(
140140
serialization_alias="processingSpecification"
141141
)
142+
notifications_url: Optional[str] = Field(
143+
serialization_alias="notificationsURL",
144+
default=None,
145+
)

0 commit comments

Comments
 (0)