Skip to content

JacksonModel#convert throws InvalidDefinitionException when trying to convert a CloudEvent for event filtering #1368

Closed as not planned

Description

@mathecruz

What happened:

When extensionByInstanceId is used in a workflow, the DefaultCloudEventPredicate tries to convert the event model's JsonNode into a CloudEvent instance via JacksonModel.as(CloudEvent.class) -> ObjectMapper.convertValue(node, CloudEvent.class).

What you expected to happen:
To use extensionByInstanceId without an exception.

How to reproduce it:

Try to execute a workflow with consumed("type").extensionByInstanceId("extensionName"), something like it:

    @Override
    public Workflow descriptor() {
        return FuncWorkflowBuilder.workflow("intelligent-newsletter")
                .tasks(agent("draftAgent", draftAgent::write, NewsletterRequest.class),
                        emitJson("draftReady", "org.acme.email.review.required", NewsletterDraft.class),
                        listen("waitHumanReview",
toOne(consumed("org.acme.newsletter.review.done").extensionByInstanceId("flowinstanceid")))
                                .outputAs((JsonNode node) -> node.isArray() ? node.get(0) : node),
                        switchWhenOrElse(h -> HumanReview.ReviewStatus.NEEDS_REVISION.equals(h.status()),
                                "humanEditorAgent", "sendNewsletter", HumanReview.class),
                        function("humanEditorAgent", humanEditorAgent::edit, HumanReview.class).then("draftReady"),
                        consume("sendNewsletter", draft -> mailService.send("subscribers@acme.finance.org", draft),
                                NewsletterDraft.class).inputFrom(input -> input.get("draft"), Map.class))
                .build();
    }

Anything else we need to know?:

You can see the stack trace error here

Environment:

  • Specification version used:

Activity

  1. self-assigned this
    on May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions