Automatically complete orders in WooCommerce

woocommerce_order_status_processing
add_action( 'woocommerce_order_status_processing', 'custom_autocomplete_order' );
function custom_autocomplete_order( $order_id ) {
    if ( ! $order_id ) {
        return;
    }
    $order = wc_get_order( $order_id );
    // get status
    $status = $order->get_status();
    if( $status == 'processing')
        $order->update_status( 'completed' );
}