Skip to content

feat(runtime): add reset executable endpoint#6738

Draft
johnBgood wants to merge 2 commits intomainfrom
feat/6028-inbound-connector-reset-endpoint
Draft

feat(runtime): add reset executable endpoint#6738
johnBgood wants to merge 2 commits intomainfrom
feat/6028-inbound-connector-reset-endpoint

Conversation

@johnBgood
Copy link
Copy Markdown
Collaborator

Description

Adds a manual reset capability for inbound connector executables:

  • POST /inbound-instances/{type}/executables/{executableId}/reset
  • Deactivates the current executable and re-activates it with a fresh instance while reusing the same context
  • Supports Activated and Cancelled states
  • Returns the updated ActiveInboundConnectorResponse after reset
  • Forwards to the correct runtime instance in multi-instance deployments

Related issues

closes #6737

Checklist

  • Backport labels are added if these code changes should be backported. No backport label is added to the latest
    release, as this branch will be rebased onto main before the next release. Example backport labels:
    • backport stable/8.8: for changes that should be included in the next 8.8.x release.
    • or backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and this
      release has already been created. The release branch will be merged back into stable/8.8 later, so the change
      will be included in future 8.8.x releases as well.
  • Tests/Integration tests for the changes have been added if applicable.

@johnBgood johnBgood self-assigned this Mar 20, 2026
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from a9af052 to 65694f1 Compare March 20, 2026 12:53
@johnBgood johnBgood requested a review from chillleader March 23, 2026 09:14
@johnBgood johnBgood marked this pull request as ready for review March 23, 2026 16:36
@johnBgood johnBgood requested a review from a team as a code owner March 23, 2026 16:36
Copilot AI review requested due to automatic review settings March 23, 2026 16:36
…set endpoint

Adds a manual reset capability for inbound connector executables:
- POST /inbound-instances/{type}/executables/{executableId}/reset
- Deactivates the current executable and re-activates it with a fresh
  instance while reusing the same context
- Supports Activated and Cancelled states
- Returns the updated ActiveInboundConnectorResponse after reset
- Forwards to the correct runtime instance in multi-instance deployments
Closes #6028
@johnBgood johnBgood force-pushed the feat/6028-inbound-connector-reset-endpoint branch from 65694f1 to 1283a2d Compare March 23, 2026 16:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a runtime-management capability to manually reset an inbound connector executable via a new REST endpoint, leveraging the existing inbound executable registry and batch processing infrastructure.

Changes:

  • Added POST /inbound-instances/{type}/executables/{executableId}/reset endpoint that triggers an executable reset and returns an ActiveInboundConnectorResponse.
  • Introduced InboundExecutableRegistry.reset(ExecutableId) and implemented it in InboundExecutableRegistryImpl.
  • Added BatchExecutableProcessor.restartFromContext(RegisteredExecutable) helper to restart using an existing executable’s context.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/instances/service/InboundInstancesService.java Adds resetExecutable(...) service method used by the REST endpoint.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/InboundExecutableRegistryImpl.java Implements registry-level reset by restarting an executable from its current state/context.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/InboundExecutableRegistry.java Extends the public registry interface with a reset(ExecutableId) API.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/BatchExecutableProcessor.java Adds restart-from-context convenience method used by reset.
connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/controller/InboundInstancesRestController.java Exposes the new reset endpoint under /inbound-instances.

camunda.endpoints.cors.mappings=/inbound-instances/**
camunda.client.prefer-rest-over-grpc=false
camunda.client.rest-address=http://localhost:8088 No newline at end of file
camunda.client.rest-address=http://localhost:8080 No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is'nt it the opposite ? 🤔


@Override
public void reset(ExecutableId id) {
var current = stateStore.get(id);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should validate the state before really doing it, there could be a race condition where this has been deactivated because a new version of the process has came, and we would reactivate it.

It could be alive without any corresponding process definition

.exceptionally(
e -> {
LOG.error("Failed to reset connector executable '{}'", id, e);
return null;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bot comment is irrelevant, the problem here is that we are missing a unified concurrency model and therefore we have to do such things, this class needs to be refactored properly at some point 😅

@johnBgood johnBgood marked this pull request as draft April 3, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a new endpoint to restart inbound connector instances directly, without redeploying the cluster

4 participants