Skip to content

Support custom result fields for Dify Calls - #7

Merged
JJasonSun merged 2 commits into
mainfrom
feat/custom-result-schema
Oct 27, 2026
Merged

JJasonSun merged 2 commits into
mainfrom
feat/custom-result-schema

Conversation

@JJasonSun

@JJasonSun JJasonSun commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

create_call and create_and_wait accept an optional result_schema for business fields such as appointment status and a requested alternative time. Blank input keeps the existing schema. Invalid schemas stop before any CALL-E request, and custom results keep their existing output paths alongside readiness, telephone outcome, and errors.

Create Call / Create and Wait
  validate custom schema or use the existing default
  CALL-E result → appointment fields → If/Else
                                     ├─ confirmed
                                     ├─ reschedule requested
                                     └─ manual review

Includes an importable appointment example and prepares version 0.3.0. Business results preserve their original values and types, including phone-named fields. Destination, metadata, and error phone fields remain masked.

Evidence

  • Before: Call creation always requested the built-in result fields. After: both tools accept a closed schema with up to 32 scalar fields; omitting it preserves the original request.
  • 191 tests pass on Python 3.12, including invalid schemas without network access, custom field types and values, default compatibility, and recovery after a lost creation response. Compile checks and plugin packaging pass.
  • The final 0.3.0 package installs in isolated Dify CE 1.17.1. Replaying the saved custom appointment request and default-schema request preserves each original Call ID, the appointment branch, and the existing result.summary mapping.
  • Final-package Dify replay and Get Call preserve false, integer 0, unknown, and an E.164 string in phone-named business fields from an official-hotline call; the destination phone remains masked.
  • The example's eight branch scenarios and two invalid-schema cases passed in Dify CE during feature acceptance on October 26. Only explicit confirmation with an available result and completed telephone outcome took the confirmation branch.

Merge Danger

Door: Two-way

Code can be reverted. Workflows using custom fields must keep a compatible plugin or update their input and result mappings before rollback. Existing workflows that omit the new input keep their schema and result paths.

Blast Radius: Calls

Custom field names are read from the result object in a Code node; they are not added to Dify's variable picker automatically. Call results and transcript text may contain personal data; the privacy policy describes the masking boundary.

@JJasonSun
JJasonSun merged commit b29f61c into main Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant