puder crearme el panel como n8n sisguiendo esta estructura de mi modelo, en el campo del step en data puede ir, el templateemailid o el idtemplatewhatsapp u otros casos que quizas tu puedas incuirlos import mongoose from "mongoose";
const step = new mongoose.Schema({ name: { type: String, required: true }, order: { type: Number, required: true }, type: { type: String, required: true, enum: ["send_email", "send_whatsapp", "assign_advisor", "notify_admin"], }, data: { type: mongoose.Schema.Types.Mixed }, position: { index: { type: Number }, x: { type: Number }, y: { type: Number }, }, delay: { amount: { type: Number }, unit: { type: String, enum: ["seconds", "minutes", "hours"] }, }, conditions: [ { field: { type: String }, operator: { type: String, enum: ["equals", "contains", "startsWith"] }, value: { type: mongoose.Schema.Types.Mixed }, }, ], }); const WorkFlowSchema = new mongoose.Schema( { name: { type: String, required: true }, trigger: { type: String }, steps: [step], development: { type: mongoose.Schema.Types.ObjectId, ref: "Development" }, isActive: { type: Boolean, default: true }, }, { timestamps: true, } ); export default mongoose.model("WorkFlow", WorkFlowSchema);
I'll create a workflow automation panel similar to n8n based on your Mongoose schema. This will include a visual editor for creating and managing workflows with different step types.
This workflow automation builder provides a visual interface similar to n8n for creating and managing workflows based on your Mongoose schema. Here's what it includes:
Visual Workflow Canvas
Step Types
Step Configuration
Workflow Management
User Interface
The workflow data structure matches your Mongoose schema, making it easy to save and load workflows from your database.
falta poder eliminar los steps y para cada email se puede elegir el template de una lista al igual que el whatsapp, agregar tambien un campo de si step es activo o no
I'll add those features to the workflow builder:
I've added all the requested features to the workflow builder:
These changes make the workflow builder more functional and closer to professional automation tools like n8n. The user can now:
The visual representation also clearly shows which steps are active and which are inactive, making it easier to understand the workflow at a glance.
agrega al step de enviar email una seccion de variables donde tenga un array de objetos el objeto tendra dos el key:"" y el value:"" en notifyadmin igual se podra seleccionar un templare de email