पाठ 6 / 25

End Node and Outputs

Define what the caller receives.

A clear output contract

A workflow finishes at an end node that selects which variables become the outputs returned to the caller (the API response or web app). Choose outputs deliberately: the answer text, a category, extracted fields, maybe a confidence or status. If the graph has several branches, make sure every path ends with the same output names (a variable aggregator helps) so callers can rely on the shape. In chatflows, an answer node streams replies to the user instead. Dify's node names, menus and options change between versions; check the current Dify documentation.

An output contract

The same shape on every branch.

end node outputs
  answer      string    text shown to the user
  category    string    billing | technical | other
  escalated   boolean   true if routed to a human
  sources     array     ids of knowledge chunks used

Return machine-readable status

A status or category field lets calling systems branch without parsing free text.

त्वरित जाँच: Why keep the same output names on every branch?

  • It reduces token usage to zero
  • It speeds up the model
  • Dify forbids different names
  • So callers can rely on a consistent response shape
Answer

So callers can rely on a consistent response shape — Predictable outputs simplify integration.