All guides

Dify parameter extraction: turn a training request into checked fields

Define fields for a synthetic training request, choose an extraction mode and check status and facts before handoff.

AINavWritten / Updated Sources checked
On this page

At a glance

Dify Parameter Extractor uses a model to convert unstructured text into parameters for downstream nodes. This task extracts topic, seats and format from a synthetic training request and delivers a definition and acceptance record. Extraction success does not establish factual correctness or a completed booking. Compare fields with the input before handoff. The scope is the current Dify Cloud node page. No login, workflow or model call was performed.

Request-to-parameter checks

  1. Source request

    Select the variable containing the request and an available model.

  2. Field extraction

    Define names, types, descriptions and required status, then choose a supported mode.

  3. Status and facts

    Check __is_success, then compare each field with the source. Failures stop normal consumption.

Fields enter handoff only after status and source checks.

Prepare one request and an available model

You need an editable Dify Cloud workflow and a configured model. Put the synthetic text below in a text input you control, then select it in the node’s Input Variable. Writing a variable name in instructions is not the same operation. Choose a model with suitable structured-output capability. The documentation does not certify a model or workspace for this article; select an actually available option. The Chinese input requests training on Python logging diagnostics, with 12 seats and online delivery, and supplies no date.

Synthetic training request in Chinese
Plain text
请整理一条培训需求:主题是 Python 日志排查,需要 12 个名额,形式为线上。没有给日期。

Define three parameters from the source meaning

Parameter definitions
NameTypeDescriptionRequired
topicstringTraining topic stated in the inputYes
seatsnumberExplicit seat count; do not infer a numberYes
formatstringonline for explicit online format; onsite for explicit in-person formatYes

The node supports string, number, boolean, array and object types, with manual definitions or imports from tools. This task defines three fields manually. The two format values are a teaching convention, not a documented enum validator. No date is supplied, so no date field is added. For missing required information, record the actual result rather than assume undocumented completion behavior.

Set instructions and a supported mode

Original extraction instructions
Plain text
Extract topic, seats, and format from the input text.
Use format values online or onsite only when the input states the format.
Do not infer dates or claim that a booking has been made.

Function Call/Tool Call uses model structured-output features. Prompt-based relies on prompting and may suit models without function calling or cases where prompting works better. Select based on actual support; a visible option does not establish compatibility. This single-input task needs no conversation history. If Memory is enabled later, check that earlier seat counts do not contaminate the current request.

Inspect status, then compare facts

After running in your own debugger, inspect __is_success: the documented values are 1 for success and 0 for failure, with __reason describing failure. Parameters are separate output variables; downstream nodes need not read an extra full JSON string. For the synthetic input, acceptance expects the stated Python logging topic, numeric 12 and online. These are requirements derived from the text, not observed outputs.

Checks before consumption
ConditionAction
__is_success is 0Keep __reason and stop normal consumption
Success but fields contradict the inputFail acceptance; revise instructions or model settings before retry
Success and factual matchDeliver checked fields and the record; no booking was made
Missing count or formatRecord actual behavior rather than supply defaults

Deliver only checked parameters

This task ends with manual parameter checks. Connecting HTTP, tools or booking actions requires their own documented nodes, conditional branches, types, ranges and permissions. No external write is configured here, so a downstream connection is not described as business success. A number type does not establish a positive integer or a count within capacity; those are business checks.

Retain evidence at the failing step

  • An unavailable model or unsupported mode stops extraction; inspect the actual setup rather than fabricate success.
  • On failure, retain the source and __reason; do not use error text as topic.
  • Missing, mistyped or invented fields fail acceptance even with a success status; keep the comparison and block consumption.
  • Any retry policy needs limits and stop conditions. Occasional success after prompt changes does not establish stability.

Verification scope

The official Cloud page was read for inputs, parameters, modes, Memory and outputs. The example and field contract are original teaching materials. No Dify workflow, model or downstream API was run; accuracy, permissions and billing were not tested. Check the installed version before applying Cloud labels to a self-hosted deployment.

Article sources

Original editorial content; official descriptions and checking suggestions are distinguished.

  1. Dify · Official sources
    View details