// AUTO-GENERATED — do not edit by hand
// Upstream: https://github.com/n8n-io/n8n/blob/master/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts
// To implement: copy to ../impl/retrieverworkflow.rs, fill in execute(), add to ../impl/mod.rs
// r8r: rust port of n8n.io
// License: Unlicense

use async_trait::async_trait;
use crate::core::error::NodeError;
use crate::core::types::*;
use crate::engine::{ExecuteCtx, Node, NodeFactory};
use std::sync::Arc;

pub struct RetrieverworkflowNode;

static META: NodeMetadata = NodeMetadata {
    name: "retrieverworkflow",
    display_name: "Workflow Retriever",
    version: &[1],
    group: &["transform"],
    description: "Use an n8n Workflow as Retriever",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "executeNotice", display_name: "The workflow will receive ", kind: PropertyKind::Notice, required: false, default: Some("") },
    PropertyDef { name: "source", display_name: "Source", kind: PropertyKind::Options, required: false, default: Some("database") },
    PropertyDef { name: "workflowId", display_name: "Workflow ID", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "workflowId", display_name: "Workflow", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "workflowJson", display_name: "Workflow JSON", kind: PropertyKind::Json, required: true, default: Some("\\n\\n\\n") },
    PropertyDef { name: "fields", display_name: "Workflow Values", kind: PropertyKind::FixedCollection, required: false, default: Some("") }
],
    credentials: &[],
};

#[async_trait]
impl Node for RetrieverworkflowNode {
    fn metadata(&self) -> &'static NodeMetadata { &META }

    async fn execute(&self, _ctx: &mut ExecuteCtx<'_>) -> Result<NodeOutput, NodeError> {
    Err(NodeError::NotYetPorted { node: "retrieverworkflow", upstream: "https://github.com/n8n-io/n8n/blob/master/packages/@n8n/nodes-langchain/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.ts" })
    }
}

inventory::submit! { NodeFactory::new("retrieverworkflow", || Arc::new(RetrieverworkflowNode)) }
