Skip to content

Workflows: extract-field-from-object fails to deliver non-string extracted values (metadata.textPreview expects string) #17

Description

@TenSpy-ai

Summary

In Terracotta workflows, a tool node running the Extract Field from Object action (extract-field-from-object, package 4299091f-3cd3-4d68-b198-0143575f471d) fails at the tool-result delivery layer whenever the extracted value is not a string. Since a very common use of this action is extracting numeric record ids (CRM ids, sequencer prospect ids, etc.), those workflows fail even though the extraction itself succeeds.

Reproduction (verified 2026-08-05)

Tool node configured with:

  • jsonObject (reference): {"result": {"data": [{"id": 123}]}}
  • fieldPath (static): result.data.0.id

Run the workflow. The node fails with:

Tool execution failed with status: ERROR — Failed to deliver tool result to workflow: [
  {
    "expected": "string",
    "code": "invalid_type",
    "path": [
      "actionInvocationOutput",
      "metadata",
      "textPreview"
    ],
    "message": "Invalid input: expected string, received number"
  }
]

Evidence that it's the envelope, not the value:

Extracted value Result
0 (number) fails — metadata.textPreview invalid_type
-1 (number) fails — same error (rules out a falsiness bug)
"-1" (string) delivers fine; downstream number-typed conditional inputs coerce it correctly

So actionInvocationOutput.metadata.textPreview appears to be validated as string but is populated with the raw extracted value.

Related edge case

The same action fails with ERROR_MISSING_INPUT — Input is invalid. Check that your JSON object has keys when jsonObject resolves to an empty object {} (e.g. an upstream lookup miss). A structured "no match" result would make lookup-miss branches expressible without a guard node in front.

Expected

  • Extracted non-string primitives (numbers, booleans) should be deliverable — presumably by stringifying textPreview while preserving the typed value in result.foundData.
  • Empty-object input ideally yields an empty/no-match result rather than a node failure.

Workarounds we're using

  • Extract numeric fields in a code node instead of this action.
  • A guard code node that substitutes a string-typed sentinel before the extractor on lookup-miss paths.

Built/observed via the Clay plugin's workflow MCP (edit_node) + CLI on Claude Code. Happy to provide more detail.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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