add_action('elementor_pro/forms/new_record', 'custom_elementor_form_action', 10, 2);

function custom_elementor_form_action($record, $handler){
    $form_data = $record->get_formatted_data();
    
    // Customize this array based on your form fields
    $post_data = array(
        'post_title' => $form_data['field_name'],
        'post_content' => $form_data['message'],
        'post_type' => 'post', // Adjust post type as needed
        'post_status' => 'publish'
    );

    $post_id = wp_insert_post($post_data);

    // You can add more customization or error handling here
}