pyspur icon indicating copy to clipboard operation
pyspur copied to clipboard

Error in SendMailNode

Open Geraldf opened this issue 5 months ago • 0 comments

When Adding a SendEmailNode with the Provider "resend" I do see the following error message in the GUI in the output schema:

Image

the export spur is below.

When I run the agent, the mail gets sent via resend, but an exception is thrown.

  File "/pyspur/backend/pyspur/nodes/base.py", line 227, in __call__
    output_validated = self.output_model.model_validate(result.model_dump())
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 627, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for SendEmailNode_1
provider
  Input should be a valid dictionary or instance of EmailProvider [type=model_type, input_value=<EmailProvider.RESEND: 'resend'>, input_type=EmailProvider]
    For further information visit https://errors.pydantic.dev/2.10/v/model_type

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/pyspur/backend/pyspur/execution/workflow_executor.py", line 628, in _execute_node
    output = await node_instance(node_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pyspur/backend/pyspur/nodes/base.py", line 240, in __call__
    raise ValueError(f"Output validation error in {self.name}: {e}") from e
ValueError: Output validation error in SendEmailNode_1: 1 validation error for SendEmailNode_1
provider
  Input should be a valid dictionary or instance of EmailProvider [type=model_type, input_value=<EmailProvider.RESEND: 'resend'>, input_type=EmailProvider]
    For further information visit https://errors.pydantic.dev/2.10/v/model_type```

**Here is the JSON Export of the SPUR**

{ "name": "New Workflow 30.6.2025, 09:26:40", "definition": { "nodes": [ { "id": "input_node", "title": "input_node", "parent_id": null, "node_type": "InputNode", "config": { "output_schema": { "input_1": "string" }, "output_json_schema": "{"type": "object", "properties": {"input_1": {"type": "string"} } }", "has_fixed_output": false, "enforce_schema": false }, "coordinates": { "x": 145, "y": 96.25 }, "dimensions": null, "subworkflow": null }, { "id": "1b3a1285-4e44-4875-9b88-63d759de5d58", "title": "SendEmailNode_1", "parent_id": null, "node_type": "SendEmailNode", "config": { "title": "SendEmailNode_1", "type": "object", "output_schema": { "provider": "string", "message_id": "string", "status": "string", "raw_response": "string" }, "output_json_schema": "{"$defs": {"EmailProvider": {"enum": ["resend", "sendgrid"], "title": "EmailProvider", "type": "string"}}, "properties": {"provider": {"$ref": "#/$defs/EmailProvider", "description": "The email provider used"}, "message_id": {"description": "The message ID from the provider", "title": "Message Id", "type": "string"}, "status": {"description": "The status of the email send operation", "title": "Status", "type": "string"}, "raw_response": {"description": "The raw response from the provider as JSON string", "title": "Raw Response", "type": "string"}}, "required": ["provider", "message_id", "status", "raw_response"], "title": "SendEmailNodeOutput", "type": "object"}", "has_fixed_output": true, "provider": "resend", "from_template": "[email protected]", "to_template": "[email protected]", "subject_template": "Important Mail from PySpur", "content_template": "{{input_node.input_1}}" }, "coordinates": { "x": 580, "y": 132.5 }, "dimensions": null, "subworkflow": null } ], "links": [ { "source_id": "input_node", "target_id": "1b3a1285-4e44-4875-9b88-63d759de5d58", "source_handle": null, "target_handle": null } ], "test_inputs": [ { "id": 1, "input_1": "Hello Mail\n\n1. This is a list\n2. This is the saceon" }, { "id": 2, "input_1": "Testmail" }, { "id": 3, "input_1": "Test Mail" }, { "id": 4, "input_1": "tttt" } ], "spur_type": "workflow" }, "description": "" }

Geraldf avatar Jul 03 '25 15:07 Geraldf