diff --git a/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java b/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java index d75250297..63ac6f7d4 100644 --- a/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java +++ b/src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java @@ -690,7 +690,7 @@ public void updateResourceInStateIndex( Script script = new Script( ScriptType.INLINE, "painless", - "ctx._source.resources_created.add(params.newResource); if(ctx._source.containsKey('error')){ctx._source.remove('error')}", + "ctx._source.resources_created.add(params.newResource);", Collections.singletonMap("newResource", newResource.resourceMap()) );