diff --git a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkflowInfo.java b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkflowInfo.java
new file mode 100644
index 0000000..67e18f8
--- /dev/null
+++ b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkflowInfo.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2024-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.workflow.api;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+
+
+/**
+ * Workflow Information Class for other applications.
+ * it has name, type and step.
+ */
+@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
+public final class WorkflowInfo {
+    private String name;
+    private String type;
+    private int step;
+
+    /**
+     * Constructor of parameters.
+     * @param name Workflow's name
+     * @param type Workflow's type
+     * @param step the number of workflow's worklet
+     */
+    private WorkflowInfo(String name, String type, int step) {
+        this.name = name;
+        this.type = type;
+        this.step = step;
+    }
+
+    /**
+     * Construct method for 'workflow'.
+     * @param workflow workflow to be converted to WorkflowInfo
+     * @return WorkflowInfo object.
+     */
+    public static WorkflowInfo of(Workflow workflow) {
+        return new WorkflowInfo(workflow.id().toString(),
+                                createTypeFromWorkletType(workflow.getProgram().get(1).workletType()),
+                                workflow.getProgram().size());
+    }
+
+
+    /**
+     * Parsing workflow type using workletType in workflow's worklet descriptions.
+     * @param workletType first workletType in workflow.
+     * @return parsed value.
+     */
+    private static String createTypeFromWorkletType(String workletType) {
+        String[] candidate = workletType.split("\\$")[0].split("\\.");
+        return candidate[candidate.length - 1];
+    }
+}
+
diff --git a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkletDataModelFieldDescription.java b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkletDataModelFieldDescription.java
new file mode 100644
index 0000000..10534ce
--- /dev/null
+++ b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkletDataModelFieldDescription.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2024-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.workflow.api;
+
+import com.google.common.base.MoreObjects;
+
+import java.util.Objects;
+
+/**
+ * Description of work-let data model field.
+ */
+public class WorkletDataModelFieldDescription {
+
+    /**
+     * Type name of work-let.
+     */
+    private final String workletType;
+
+    /**
+     * Data model path.
+     */
+    private final String path;
+
+    /**
+     * Class of work-let field.
+     */
+    private final Class fieldType;
+
+    /**
+     * Option for whether this field is mandatory or optional.
+     */
+    private final boolean optional;
+
+    /**
+     * Gets path attribute of this data model.
+     * @return path attribute of this data model
+     */
+    public String path() {
+        return this.path;
+    }
+
+    /**
+     * Constructor of worklet data model field description.
+     *
+     * @param workletType worklet type
+     * @param path        path of data model
+     * @param fieldType        type of data model
+     * @param optional    optional
+     */
+    public WorkletDataModelFieldDescription(String workletType, String path, Class fieldType, boolean optional) {
+        this.workletType = workletType;
+        this.path = path;
+        this.fieldType = fieldType;
+        this.optional = optional;
+    }
+
+    /**
+     * Checks the attributes of worklet data model field.
+     *
+     * @param desc worklet data model description
+     * @return true means that this worklet data model field description has same attributes with desc
+     */
+    public boolean hasSameAttributes(WorkletDataModelFieldDescription desc) {
+
+        if (!Objects.equals(fieldType, desc.fieldType)) {
+            return false;
+        }
+        return Objects.equals(optional, desc.optional);
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 3;
+        hash = 59 * hash + Objects.hashCode(this.workletType);
+        hash = 59 * hash + Objects.hashCode(this.path);
+        hash = 59 * hash + Objects.hashCode(this.fieldType);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final WorkletDataModelFieldDescription other = (WorkletDataModelFieldDescription) obj;
+
+        if (!Objects.equals(this.workletType, other.workletType)) {
+            return false;
+        }
+        if (!Objects.equals(this.path, other.path)) {
+            return false;
+        }
+        return Objects.equals(this.fieldType, other.fieldType);
+    }
+
+    @Override
+    public String toString() {
+        return MoreObjects.toStringHelper(getClass())
+                .add("worklet", workletType)
+                .add("path", path)
+                .add("fieldType", fieldType)
+                .add("optional", optional)
+                .toString();
+    }
+}
+
